home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 June: Reference Library / Dev.CD Jun 94.toast / Technical Documentation / Mac Tech Notes (DocViewer) / Files / TN-Files < prev   
MacBinary  |  1994-04-27  |  1.3 MB  |  [ONLN/HLX2]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
100% file MacBinary II, inited, Thu Jul 15 15:17:28 1993, modified Wed Apr 27 06:13:40 1994, creator 'HLX2', type 'ONLN', 1329396 bytes "TN-Files" , at 0x144974 39216 bytes resource default (weak)
99% file data default
100% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[ONLN]
macFileCreator[HLX2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 54 4e 2d 46 69 6c | 65 73 00 00 00 00 00 00 |..TN-Fil|es......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 4f 4e 4c 4e 48 4c 58 | 32 01 00 00 00 00 00 00 |.ONLNHLX|2.......|
|00000050| 00 00 00 00 14 48 f4 00 | 00 99 30 a8 6b 5d c8 a9 |.....H..|..0.k]..|
|00000060| e3 eb 54 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..T.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 f1 d4 00 00 |........|........|
|00000080| 4e 6f 74 69 63 65 3a 20 | 54 68 65 20 69 6e 66 6f |Notice: |The info|
|00000090| 72 6d 61 74 69 6f 6e 20 | 69 6e 66 6f 75 6e 64 20 |rmation |infound |
|000000a0| 69 6e 20 49 6e 73 69 64 | 65 20 4d 61 63 69 6e 74 |in Insid|e Macint|
|000000b0| 6f 73 68 3a 46 69 6c 65 | 73 20 70 61 67 65 20 32 |osh:File|s page 2|
|000000c0| 2d 31 34 34 2e 20 20 54 | 68 69 73 20 6e 6f 74 65 |-144. T|his note|
|000000d0| 20 77 69 6c 6c 20 62 65 | 20 72 65 6d 6f 76 65 64 | will be| removed|
|000000e0| 20 66 72 6f 6d 20 74 68 | 65 20 54 65 63 68 6e 69 | from th|e Techni|
|000000f0| 63 61 6c 20 4e 6f 74 65 | 20 6c 69 62 72 61 72 79 |cal Note| library|
|00000100| 20 69 6e 20 74 68 65 20 | 6e 65 61 72 20 66 75 74 | in the |near fut|
|00000110| 75 72 65 2e 0d 46 4c 20 | 31 20 2d 20 41 76 61 69 |ure..FL |1 - Avai|
|00000120| 6c 61 62 6c 65 20 56 6f | 6c 75 6d 65 73 0d 46 69 |lable Vo|lumes.Fi|
|00000130| 6c 65 73 09 09 0d 52 65 | 76 69 73 65 64 20 62 79 |les...Re|vised by|
|00000140| 3a 09 42 72 79 61 6e 20 | 53 74 65 72 6e 73 09 4f |:.Bryan |Sterns.O|
|00000150| 63 74 6f 62 65 72 20 31 | 39 38 35 0d 09 09 09 4d |ctober 1|985....M|
|00000160| 61 72 63 68 20 31 39 38 | 38 0d 57 72 69 74 74 65 |arch 198|8.Writte|
|00000170| 6e 20 62 79 3a 09 42 72 | 79 61 6e 20 53 74 65 72 |n by:.Br|yan Ster|
|00000180| 6e 73 09 41 70 72 69 6c | 20 31 39 38 35 0d 53 74 |ns.April| 1985.St|
|00000190| 61 6e 64 61 72 64 20 46 | 69 6c 65 20 6c 65 74 73 |andard F|ile lets|
|000001a0| 20 74 68 65 20 75 73 65 | 72 20 73 65 6c 65 63 74 | the use|r select|
|000001b0| 20 6f 6e 65 20 66 69 6c | 65 20 66 72 6f 6d 20 61 | one fil|e from a|
|000001c0| 6e 79 20 61 76 61 69 6c | 61 62 6c 65 20 76 6f 6c |ny avail|able vol|
|000001d0| 75 6d 65 3b 20 69 74 20 | 69 73 20 73 6f 6d 65 74 |ume; it |is somet|
|000001e0| 69 6d 65 73 20 6e 65 63 | 65 73 73 61 72 79 20 66 |imes nec|essary f|
|000001f0| 6f 72 20 61 6e 20 61 70 | 70 6c 69 63 61 74 69 6f |or an ap|plicatio|
|00000200| 6e 20 74 6f 20 66 69 6e | 64 20 77 68 69 63 68 20 |n to fin|d which |
|00000210| 76 6f 6c 75 6d 65 73 20 | 61 72 65 20 70 72 65 73 |volumes |are pres|
|00000220| 65 6e 74 2e 20 54 68 69 | 73 20 74 65 63 68 6e 69 |ent. Thi|s techni|
|00000230| 63 61 6c 20 6e 6f 74 65 | 20 67 69 76 65 73 20 74 |cal note| gives t|
|00000240| 68 65 20 70 72 6f 70 65 | 72 20 6d 65 74 68 6f 64 |he prope|r method|
|00000250| 20 6f 66 20 61 63 63 6f | 6d 70 6c 69 73 68 69 6e | of acco|mplishin|
|00000260| 67 20 74 68 69 73 2e 0d | 54 68 65 72 65 20 69 73 |g this..|There is|
|00000270| 20 61 20 6c 69 74 74 6c | 65 2d 6e 6f 74 69 63 65 | a littl|e-notice|
|00000280| 64 20 66 65 61 74 75 72 | 65 20 6f 66 20 74 68 65 |d featur|e of the|
|00000290| 20 6c 6f 77 2d 6c 65 76 | 65 6c 20 66 69 6c 65 20 | low-lev|el file |
|000002a0| 6d 61 6e 61 67 65 72 20 | 63 61 6c 6c 20 50 42 48 |manager |call PBH|
|000002b0| 47 65 74 56 49 6e 66 6f | 20 77 68 69 63 68 20 61 |GetVInfo| which a|
|000002c0| 6c 6c 6f 77 73 20 73 70 | 65 63 69 66 69 63 61 74 |llows sp|ecificat|
|000002d0| 69 6f 6e 20 6f 66 20 61 | 20 d2 76 6f 6c 75 6d 65 |ion of a| .volume|
|000002e0| 20 69 6e 64 65 78 d3 20 | 74 6f 20 73 65 6c 65 63 | index. |to selec|
|000002f0| 74 20 74 68 65 20 76 6f | 6c 75 6d 65 2e 20 54 68 |t the vo|lume. Th|
|00000300| 69 73 20 76 6f 6c 75 6d | 65 20 69 6e 64 65 78 20 |is volum|e index |
|00000310| 73 65 6c 65 63 74 73 20 | 74 68 65 20 6e 74 68 20 |selects |the nth |
|00000320| 76 6f 6c 75 6d 65 20 69 | 6e 20 74 68 65 20 56 43 |volume i|n the VC|
|00000330| 42 20 71 75 65 75 65 2e | 20 54 68 65 20 66 6f 6c |B queue.| The fol|
|00000340| 6c 6f 77 69 6e 67 20 66 | 75 6e 63 74 69 6f 6e 20 |lowing f|unction |
|00000350| 75 73 65 73 20 50 42 48 | 47 65 74 56 49 6e 66 6f |uses PBH|GetVInfo|
|00000360| 20 74 6f 20 66 69 6e 64 | 20 6f 75 74 20 61 62 6f | to find| out abo|
|00000370| 75 74 20 61 20 67 69 76 | 65 6e 20 76 6f 6c 75 6d |ut a giv|en volum|
|00000380| 65 2e 20 20 49 6e 20 4d | 50 57 20 50 61 73 63 61 |e. In M|PW Pasca|
|00000390| 6c 3a 0d 09 46 55 4e 43 | 54 49 4f 4e 20 47 65 74 |l:..FUNC|TION Get|
|000003a0| 49 6e 64 56 6f 6c 75 6d | 65 28 77 68 69 63 68 56 |IndVolum|e(whichV|
|000003b0| 6f 6c 3a 20 49 4e 54 45 | 47 45 52 3b 20 56 41 52 |ol: INTE|GER; VAR|
|000003c0| 20 76 6f 6c 4e 61 6d 65 | 3a 20 53 74 72 32 35 35 | volName|: Str255|
|000003d0| 3b 0d 09 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;.. | |
|000003e0| 20 20 20 20 20 20 20 20 | 20 56 41 52 20 76 6f 6c | | VAR vol|
|000003f0| 52 65 66 4e 75 6d 3a 20 | 49 4e 54 45 47 45 52 29 |RefNum: |INTEGER)|
|00000400| 3a 20 4f 53 45 72 72 3b | 0d 09 7b 52 65 74 75 72 |: OSErr;|..{Retur|
|00000410| 6e 20 74 68 65 20 6e 61 | 6d 65 20 61 6e 64 20 76 |n the na|me and v|
|00000420| 52 65 66 4e 75 6d 20 6f | 66 20 76 6f 6c 75 6d 65 |RefNum o|f volume|
|00000430| 20 73 70 65 63 69 66 69 | 65 64 20 62 79 20 77 68 | specifi|ed by wh|
|00000440| 69 63 68 56 6f 6c 2e 7d | 0d 09 20 20 20 56 41 52 |ichVol.}|.. VAR|
|00000450| 0d 09 20 20 20 20 20 20 | 76 6f 6c 50 42 20 3a 20 |.. |volPB : |
|00000460| 48 50 61 72 61 6d 42 6c | 6f 63 6b 52 65 63 3b 0d |HParamBl|ockRec;.|
|00000470| 09 20 20 20 20 20 20 65 | 72 72 6f 72 20 3a 20 4f |. e|rror : O|
|00000480| 53 45 72 72 3b 0d 09 20 | 20 20 42 45 47 49 4e 0d |SErr;.. | BEGIN.|
|00000490| 09 20 20 20 20 20 20 57 | 49 54 48 20 76 6f 6c 50 |. W|ITH volP|
|000004a0| 42 20 44 4f 20 42 45 47 | 49 4e 20 20 20 20 20 20 |B DO BEG|IN |
|000004b0| 20 20 7b 6d 61 6b 65 73 | 20 69 74 20 65 61 73 69 | {makes| it easi|
|000004c0| 65 72 20 74 6f 20 66 69 | 6c 6c 20 69 6e 21 7d 0d |er to fi|ll in!}.|
|000004d0| 09 20 20 20 20 20 20 20 | 20 20 69 6f 4e 61 6d 65 |. | ioName|
|000004e0| 50 74 72 20 20 3a 3d 20 | 40 76 6f 6c 4e 61 6d 65 |Ptr := |@volName|
|000004f0| 3b 20 7b 6d 61 6b 65 20 | 73 75 72 65 20 69 74 20 |; {make |sure it |
|00000500| 72 65 74 75 72 6e 73 20 | 74 68 65 20 6e 61 6d 65 |returns |the name|
|00000510| 7d 0d 09 20 20 20 20 20 | 20 20 20 20 69 6f 56 52 |}.. | ioVR|
|00000520| 65 66 4e 75 6d 20 20 3a | 3d 20 30 3b 20 20 20 20 |efNum :|= 0; |
|00000530| 20 20 20 20 7b 30 20 6d | 65 61 6e 73 20 75 73 65 | {0 m|eans use|
|00000540| 20 69 6f 56 6f 6c 49 6e | 64 65 78 7d 0d 09 20 20 | ioVolIn|dex}.. |
|00000550| 20 20 20 20 20 20 20 69 | 6f 56 6f 6c 49 6e 64 65 | i|oVolInde|
|00000560| 78 20 3a 3d 20 77 68 69 | 63 68 56 6f 6c 3b 20 7b |x := whi|chVol; {|
|00000570| 75 73 65 20 74 68 69 73 | 20 74 6f 20 64 65 74 65 |use this| to dete|
|00000580| 72 6d 69 6e 65 20 74 68 | 65 20 76 6f 6c 75 6d 65 |rmine th|e volume|
|00000590| 7d 0d 09 20 20 20 20 20 | 20 45 4e 44 3b 20 7b 77 |}.. | END; {w|
|000005a0| 69 74 68 7d 0d 09 20 20 | 20 20 20 20 65 72 72 6f |ith}.. | erro|
|000005b0| 72 20 3a 3d 20 50 42 48 | 47 65 74 56 49 6e 66 6f |r := PBH|GetVInfo|
|000005c0| 28 40 76 6f 6c 50 42 2c | 66 61 6c 73 65 29 3b 20 |(@volPB,|false); |
|000005d0| 7b 64 6f 20 69 74 7d 0d | 09 20 20 20 20 20 20 49 |{do it}.|. I|
|000005e0| 46 20 65 72 72 6f 72 20 | 3d 20 6e 6f 45 72 72 20 |F error |= noErr |
|000005f0| 54 48 45 4e 20 42 45 47 | 49 4e 20 20 20 20 20 20 |THEN BEG|IN |
|00000600| 7b 69 66 20 6e 6f 20 65 | 72 72 6f 72 20 6f 63 63 |{if no e|rror occ|
|00000610| 75 72 72 65 64 20 7d 0d | 09 20 20 20 20 20 20 20 |urred }.|. |
|00000620| 20 20 76 6f 6c 52 65 66 | 4e 75 6d 20 3a 3d 20 76 | volRef|Num := v|
|00000630| 6f 6c 50 42 2e 69 6f 56 | 52 65 66 4e 75 6d 3b 20 |olPB.ioV|RefNum; |
|00000640| 7b 72 65 74 75 72 6e 20 | 74 68 65 20 76 6f 6c 75 |{return |the volu|
|00000650| 6d 65 20 72 65 66 65 72 | 65 6e 63 65 7d 0d 09 20 |me refer|ence}.. |
|00000660| 20 20 20 20 20 45 4e 44 | 3b 20 7b 69 66 20 6e 6f | END|; {if no|
|00000670| 20 65 72 72 6f 72 7d 0d | 09 20 20 20 20 20 20 7b | error}.|. {|
|00000680| 6f 74 68 65 72 20 69 6e | 66 6f 72 6d 61 74 69 6f |other in|formatio|
|00000690| 6e 20 69 73 20 61 76 61 | 69 6c 61 62 6c 65 20 66 |n is ava|ilable f|
|000006a0| 72 6f 6d 20 74 68 69 73 | 20 72 65 63 6f 72 64 3b |rom this| record;|
|000006b0| 20 73 65 65 20 74 68 65 | 20 46 49 4c 45 7d 0d 09 | see the| FILE}..|
|000006c0| 20 20 20 20 20 20 7b 4d | 61 6e 61 67 65 72 27 73 | {M|anager's|
|000006d0| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 20 6f 66 20 | descrip|tion of |
|000006e0| 50 42 48 47 65 74 56 49 | 6e 66 6f 20 66 6f 72 20 |PBHGetVI|nfo for |
|000006f0| 6d 6f 72 65 20 64 65 74 | 61 69 6c 73 2e 2e 2e 7d |more det|ails...}|
|00000700| 0d 09 20 20 20 20 20 20 | 47 65 74 49 6e 64 56 6f |.. |GetIndVo|
|00000710| 6c 75 6d 65 20 3a 3d 20 | 65 72 72 6f 72 3b 20 7b |lume := |error; {|
|00000720| 72 65 74 75 72 6e 20 65 | 72 72 6f 72 20 63 6f 64 |return e|rror cod|
|00000730| 65 7d 0d 09 20 20 20 45 | 4e 44 3b 0d 49 6e 20 4d |e}.. E|ND;.In M|
|00000740| 50 57 20 43 3a 0d 4f 53 | 45 72 72 20 47 65 74 49 |PW C:.OS|Err GetI|
|00000750| 6e 64 56 6f 6c 75 6d 65 | 28 77 68 69 63 68 56 6f |ndVolume|(whichVo|
|00000760| 6c 2c 76 6f 6c 4e 61 6d | 65 2c 76 6f 6c 52 65 66 |l,volNam|e,volRef|
|00000770| 4e 75 6d 29 0d 73 68 6f | 72 74 20 69 6e 74 20 77 |Num).sho|rt int w|
|00000780| 68 69 63 68 56 6f 6c 3b | 0d 63 68 61 72 09 2a 76 |hichVol;|.char.*v|
|00000790| 6f 6c 4e 61 6d 65 3b 0d | 73 68 6f 72 74 20 69 6e |olName;.|short in|
|000007a0| 74 20 2a 76 6f 6c 52 65 | 66 4e 75 6d 3b 0d 7b 0d |t *volRe|fNum;.{.|
|000007b0| 09 2f 2a 52 65 74 75 72 | 6e 20 74 68 65 20 6e 61 |./*Retur|n the na|
|000007c0| 6d 65 20 61 6e 64 20 76 | 52 65 66 4e 75 6d 20 6f |me and v|RefNum o|
|000007d0| 66 20 76 6f 6c 75 6d 65 | 20 73 70 65 63 69 66 69 |f volume| specifi|
|000007e0| 65 64 20 62 79 20 77 68 | 69 63 68 56 6f 6c 2e 2a |ed by wh|ichVol.*|
|000007f0| 2f 0d 09 48 56 6f 6c 75 | 6d 65 50 61 72 61 6d 09 |/..HVolu|meParam.|
|00000800| 76 6f 6c 50 42 3b 0d 09 | 4f 53 45 72 72 09 09 09 |volPB;..|OSErr...|
|00000810| 65 72 72 6f 72 3b 0d 09 | 20 20 20 0d 09 76 6f 6c |error;..| ..vol|
|00000820| 50 42 2e 69 6f 4e 61 6d | 65 50 74 72 20 3d 20 76 |PB.ioNam|ePtr = v|
|00000830| 6f 6c 4e 61 6d 65 3b 20 | 2f 2a 6d 61 6b 65 20 73 |olName; |/*make s|
|00000840| 75 72 65 20 69 74 20 72 | 65 74 75 72 6e 73 20 74 |ure it r|eturns t|
|00000850| 68 65 20 6e 61 6d 65 2a | 2f 0d 09 76 6f 6c 50 42 |he name*|/..volPB|
|00000860| 2e 69 6f 56 52 65 66 4e | 75 6d 20 3d 20 30 3b 20 |.ioVRefN|um = 0; |
|00000870| 20 20 20 20 20 20 2f 2a | 30 20 6d 65 61 6e 73 20 | /*|0 means |
|00000880| 75 73 65 20 69 6f 56 6f | 6c 49 6e 64 65 78 2a 2f |use ioVo|lIndex*/|
|00000890| 0d 09 76 6f 6c 50 42 2e | 69 6f 56 6f 6c 49 6e 64 |..volPB.|ioVolInd|
|000008a0| 65 78 20 3d 20 77 68 69 | 63 68 56 6f 6c 3b 20 2f |ex = whi|chVol; /|
|000008b0| 2a 75 73 65 20 74 68 69 | 73 20 74 6f 20 64 65 74 |*use thi|s to det|
|000008c0| 65 72 6d 69 6e 65 20 74 | 68 65 20 76 6f 6c 75 6d |ermine t|he volum|
|000008d0| 65 2a 2f 0d 09 65 72 72 | 6f 72 20 3d 20 50 42 48 |e*/..err|or = PBH|
|000008e0| 47 65 74 56 49 6e 66 6f | 28 26 76 6f 6c 50 42 2c |GetVInfo|(&volPB,|
|000008f0| 66 61 6c 73 65 29 3b 20 | 2f 2a 64 6f 20 69 74 2a |false); |/*do it*|
|00000900| 2f 0d 09 69 66 20 28 65 | 72 72 6f 72 20 3d 3d 20 |/..if (e|rror == |
|00000910| 6e 6f 45 72 72 29 20 20 | 20 2f 2a 69 66 20 6e 6f |noErr) | /*if no|
|00000920| 20 65 72 72 6f 72 20 6f | 63 63 75 72 72 65 64 20 | error o|ccurred |
|00000930| 2a 2f 0d 09 09 2a 76 6f | 6c 52 65 66 4e 75 6d 20 |*/...*vo|lRefNum |
|00000940| 3d 20 76 6f 6c 50 42 2e | 69 6f 56 52 65 66 4e 75 |= volPB.|ioVRefNu|
|00000950| 6d 3b 20 2f 2a 72 65 74 | 75 72 6e 20 74 68 65 20 |m; /*ret|urn the |
|00000960| 76 6f 6c 75 6d 65 20 72 | 65 66 65 72 65 6e 63 65 |volume r|eference|
|00000970| 2a 2f 0d 09 2f 2a 6f 74 | 68 65 72 20 69 6e 66 6f |*/../*ot|her info|
|00000980| 72 6d 61 74 69 6f 6e 20 | 69 73 20 61 76 61 69 6c |rmation |is avail|
|00000990| 61 62 6c 65 20 66 72 6f | 6d 20 74 68 69 73 20 72 |able fro|m this r|
|000009a0| 65 63 6f 72 64 3b 20 73 | 65 65 20 74 68 65 20 46 |ecord; s|ee the F|
|000009b0| 49 4c 45 2a 2f 0d 09 2f | 2a 4d 61 6e 61 67 65 72 |ILE*/../|*Manager|
|000009c0| 27 73 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 6f |'s descr|iption o|
|000009d0| 66 20 50 42 48 47 65 74 | 56 49 6e 66 6f 20 66 6f |f PBHGet|VInfo fo|
|000009e0| 72 20 6d 6f 72 65 20 64 | 65 74 61 69 6c 73 2e 2e |r more d|etails..|
|000009f0| 2e 2a 2f 0d 09 20 20 20 | 20 20 20 0d 09 72 65 74 |.*/.. | ..ret|
|00000a00| 75 72 6e 28 65 72 72 6f | 72 29 3b 20 20 20 2f 2a |urn(erro|r); /*|
|00000a10| 61 6c 77 61 79 73 20 72 | 65 74 75 72 6e 20 65 72 |always r|eturn er|
|00000a20| 72 6f 72 20 63 6f 64 65 | 2a 2f 0d 7d 20 2f 2a 20 |ror code|*/.} /* |
|00000a30| 47 65 74 49 6e 64 56 6f | 6c 75 6d 65 20 2a 2f 0d |GetIndVo|lume */.|
|00000a40| 54 6f 20 66 69 6e 64 20 | 6f 75 74 20 61 62 6f 75 |To find |out abou|
|00000a50| 74 20 61 6c 6c 20 76 6f | 6c 75 6d 65 73 20 6f 6e |t all vo|lumes on|
|00000a60| 2d 6c 69 6e 65 2c 20 79 | 6f 75 20 63 61 6e 20 63 |-line, y|ou can c|
|00000a70| 61 6c 6c 20 74 68 69 73 | 20 72 6f 75 74 69 6e 65 |all this| routine|
|00000a80| 20 73 65 76 65 72 61 6c | 20 74 69 6d 65 73 2c 20 | several| times, |
|00000a90| 73 74 61 72 74 69 6e 67 | 20 61 74 20 77 68 69 63 |starting| at whic|
|00000aa0| 68 56 6f 6c 20 3a 3d 20 | 31 20 61 6e 64 20 69 6e |hVol := |1 and in|
|00000ab0| 63 72 65 6d 65 6e 74 69 | 6e 67 20 77 68 69 63 68 |crementi|ng which|
|00000ac0| 56 6f 6c 20 75 6e 74 69 | 6c 20 74 68 65 20 72 6f |Vol unti|l the ro|
|00000ad0| 75 74 69 6e 65 20 72 65 | 74 75 72 6e 73 20 6e 73 |utine re|turns ns|
|00000ae0| 76 45 72 72 2e 0d 46 75 | 72 74 68 65 72 20 52 65 |vErr..Fu|rther Re|
|00000af0| 66 65 72 65 6e 63 65 3a | 0d a5 09 54 68 65 20 46 |ference:|...The F|
|00000b00| 69 6c 65 20 4d 61 6e 61 | 67 65 72 0d 4e 6f 74 69 |ile Mana|ger.Noti|
|00000b10| 63 65 3a 20 54 68 65 20 | 69 6e 66 6f 72 6d 61 74 |ce: The |informat|
|00000b20| 69 6f 6e 20 69 6e 20 74 | 68 69 73 20 54 65 63 68 |ion in t|his Tech|
|00000b30| 6e 69 63 61 6c 20 4e 6f | 74 65 20 63 61 6e 20 6e |nical No|te can n|
|00000b40| 6f 77 20 62 65 20 66 6f | 75 6e 64 20 69 6e 20 49 |ow be fo|und in I|
|00000b50| 6e 73 69 64 65 20 4d 61 | 63 69 6e 74 6f 73 68 3a |nside Ma|cintosh:|
|00000b60| 46 69 6c 65 73 2e 20 20 | 54 68 69 73 20 6e 6f 74 |Files. |This not|
|00000b70| 65 20 77 69 6c 6c 20 62 | 65 20 72 65 6d 6f 76 65 |e will b|e remove|
|00000b80| 64 20 66 72 6f 6d 20 74 | 68 65 20 54 65 63 68 6e |d from t|he Techn|
|00000b90| 69 63 61 6c 20 4e 6f 74 | 65 20 6c 69 62 72 61 72 |ical Not|e librar|
|00000ba0| 79 20 69 6e 20 74 68 65 | 20 6e 65 61 72 20 66 75 |y in the| near fu|
|00000bb0| 74 75 72 65 2e 0d 46 4c | 20 32 20 2d 20 43 6c 65 |ture..FL| 2 - Cle|
|00000bc0| 61 72 69 6e 67 20 69 6f | 43 6f 6d 70 6c 65 74 69 |aring io|Completi|
|00000bd0| 6f 6e 0d 46 69 6c 65 73 | 09 09 0d 52 65 76 69 73 |on.Files|...Revis|
|00000be0| 65 64 20 62 79 3a 09 09 | 4d 61 72 63 68 20 31 39 |ed by:..|March 19|
|00000bf0| 38 38 0d 57 72 69 74 74 | 65 6e 20 62 79 3a 09 4a |88.Writt|en by:.J|
|00000c00| 69 6d 20 46 72 69 65 64 | 6c 61 6e 64 65 72 09 4d |im Fried|lander.M|
|00000c10| 61 79 20 31 39 38 37 0d | 57 68 65 6e 20 6d 61 6b |ay 1987.|When mak|
|00000c20| 69 6e 67 20 73 79 6e 63 | 68 72 6f 6e 6f 75 73 20 |ing sync|hronous |
|00000c30| 63 61 6c 6c 73 20 74 6f | 20 74 68 65 20 46 69 6c |calls to| the Fil|
|00000c40| 65 20 4d 61 6e 61 67 65 | 72 2c 20 69 74 20 69 73 |e Manage|r, it is|
|00000c50| 20 6e 6f 74 20 6e 65 63 | 65 73 73 61 72 79 20 74 | not nec|essary t|
|00000c60| 6f 20 63 6c 65 61 72 20 | 69 6f 43 6f 6d 70 6c 65 |o clear |ioComple|
|00000c70| 74 69 6f 6e 20 66 69 65 | 6c 64 20 6f 66 20 74 68 |tion fie|ld of th|
|00000c80| 65 20 70 61 72 61 6d 65 | 74 65 72 20 62 6c 6f 63 |e parame|ter bloc|
|00000c90| 6b 2c 20 73 69 6e 63 65 | 20 74 68 61 74 20 69 73 |k, since| that is|
|00000ca0| 20 64 6f 6e 65 20 66 6f | 72 20 79 6f 75 2e 0d 53 | done fo|r you..S|
|00000cb0| 6f 6d 65 20 65 61 72 6c | 69 65 72 20 74 65 63 68 |ome earl|ier tech|
|00000cc0| 6e 6f 74 65 73 20 65 78 | 70 6c 69 63 69 74 6c 79 |notes ex|plicitly|
|00000cd0| 20 63 6c 65 61 72 65 64 | 20 69 6f 43 6f 6d 70 6c | cleared| ioCompl|
|00000ce0| 65 74 69 6f 6e 2c 20 77 | 69 74 68 20 74 68 65 20 |etion, w|ith the |
|00000cf0| 6b 6e 6f 77 6c 65 64 67 | 65 20 74 68 61 74 20 74 |knowledg|e that t|
|00000d00| 68 69 73 20 77 61 73 20 | 75 6e 6e 65 63 65 73 73 |his was |unnecess|
|00000d10| 61 72 79 2c 20 74 6f 20 | 74 72 79 20 74 6f 20 65 |ary, to |try to e|
|00000d20| 6e 63 6f 75 72 61 67 65 | 20 64 65 76 65 6c 6f 70 |ncourage| develop|
|00000d30| 65 72 73 20 74 6f 20 66 | 69 6c 6c 20 69 6e 20 61 |ers to f|ill in a|
|00000d40| 6c 6c 20 66 69 65 6c 64 | 73 20 6f 66 20 70 61 72 |ll field|s of par|
|00000d50| 61 6d 65 74 65 72 20 62 | 6c 6f 63 6b 73 20 61 73 |ameter b|locks as|
|00000d60| 20 69 6e 64 69 63 61 74 | 65 64 20 69 6e 20 49 6e | indicat|ed in In|
|00000d70| 73 69 64 65 20 4d 61 63 | 69 6e 74 6f 73 68 2e 20 |side Mac|intosh. |
|00000d80| 0d 42 79 20 74 68 65 20 | 77 61 79 2c 20 74 68 69 |.By the |way, thi|
|00000d90| 73 20 69 73 20 74 72 75 | 65 20 6f 66 20 61 6c 6c |s is tru|e of all|
|00000da0| 20 70 61 72 61 6d 65 74 | 65 72 20 63 61 6c 6c 73 | paramet|er calls|
|00000db0| d1 79 6f 75 20 6f 6e 6c | 79 20 68 61 76 65 20 74 |.you onl|y have t|
|00000dc0| 6f 20 73 65 74 20 66 69 | 65 6c 64 73 20 74 68 61 |o set fi|elds tha|
|00000dd0| 74 20 61 72 65 20 65 78 | 70 6c 69 63 69 74 6c 79 |t are ex|plicitly|
|00000de0| 20 72 65 71 75 69 72 65 | 64 2e 0d 46 75 72 74 68 | require|d..Furth|
|00000df0| 65 72 20 52 65 66 65 72 | 65 6e 63 65 3a 0d a5 09 |er Refer|ence:...|
|00000e00| 54 68 65 20 46 69 6c 65 | 20 4d 61 6e 61 67 65 72 |The File| Manager|
|00000e10| 0d 4e 6f 74 69 63 65 3a | 20 54 68 65 20 69 6e 66 |.Notice:| The inf|
|00000e20| 6f 72 6d 61 74 69 6f 6e | 20 69 6e 20 74 68 69 73 |ormation| in this|
|00000e30| 20 54 65 63 68 6e 69 63 | 61 6c 20 4e 6f 74 65 20 | Technic|al Note |
|00000e40| 63 61 6e 20 6e 6f 77 20 | 62 65 20 66 6f 75 6e 64 |can now |be found|
|00000e50| 20 69 6e 20 49 6e 73 69 | 64 65 20 4d 61 63 69 6e | in Insi|de Macin|
|00000e60| 74 6f 73 68 3a 46 69 6c | 65 73 20 70 61 67 65 20 |tosh:Fil|es page |
|00000e70| 32 2d 32 33 37 2e 20 20 | 54 68 69 73 20 6e 6f 74 |2-237. |This not|
|00000e80| 65 20 77 69 6c 6c 20 62 | 65 20 72 65 6d 6f 76 65 |e will b|e remove|
|00000e90| 64 20 66 72 6f 6d 20 74 | 68 65 20 54 65 63 68 6e |d from t|he Techn|
|00000ea0| 69 63 61 6c 20 4e 6f 74 | 65 20 6c 69 62 72 61 72 |ical Not|e librar|
|00000eb0| 79 20 69 6e 20 74 68 65 | 20 6e 65 61 72 20 66 75 |y in the| near fu|
|00000ec0| 74 75 72 65 2e 0d 46 4c | 20 32 20 2d 20 45 72 72 |ture..FL| 2 - Err|
|00000ed0| 6f 72 20 69 6e 20 46 43 | 42 50 42 52 65 63 0d 46 |or in FC|BPBRec.F|
|00000ee0| 69 6c 65 73 09 09 0d 52 | 65 76 69 73 65 64 20 62 |iles...R|evised b|
|00000ef0| 79 3a 09 09 4d 61 72 63 | 68 20 31 39 38 38 0d 57 |y:..Marc|h 1988.W|
|00000f00| 72 69 74 74 65 6e 20 62 | 79 3a 09 4a 69 6d 20 46 |ritten b|y:.Jim F|
|00000f10| 72 69 65 64 6c 61 6e 64 | 65 72 09 41 75 67 75 73 |riedland|er.Augus|
|00000f20| 74 20 31 39 38 36 0d 54 | 68 65 20 64 65 63 6c 61 |t 1986.T|he decla|
|00000f30| 72 61 74 69 6f 6e 20 6f | 66 20 61 20 46 43 42 50 |ration o|f a FCBP|
|00000f40| 42 52 65 63 20 69 73 20 | 77 72 6f 6e 67 20 69 6e |BRec is |wrong in|
|00000f50| 20 49 6e 73 69 64 65 20 | 4d 61 63 69 6e 74 6f 73 | Inside |Macintos|
|00000f60| 68 20 56 6f 6c 75 6d 65 | 20 49 56 20 20 61 6e 64 |h Volume| IV and|
|00000f70| 20 65 61 72 6c 79 20 76 | 65 72 73 69 6f 6e 73 20 | early v|ersions |
|00000f80| 6f 66 20 4d 50 57 2e 20 | 54 68 69 73 20 68 61 73 |of MPW. |This has|
|00000f90| 20 62 65 65 6e 20 66 69 | 78 65 64 20 69 6e 20 4d | been fi|xed in M|
|00000fa0| 50 57 20 31 2e 30 20 61 | 6e 64 20 6e 65 77 65 72 |PW 1.0 a|nd newer|
|00000fb0| 2e 0d 41 6e 20 65 72 72 | 6f 72 20 77 61 73 20 6d |..An err|or was m|
|00000fc0| 61 64 65 20 69 6e 20 74 | 68 65 20 64 65 63 6c 61 |ade in t|he decla|
|00000fd0| 72 61 74 69 6f 6e 20 6f | 66 20 61 6e 20 46 43 42 |ration o|f an FCB|
|00000fe0| 50 42 52 65 63 20 70 61 | 72 61 6d 65 74 65 72 20 |PBRec pa|rameter |
|00000ff0| 62 6c 6f 63 6b 20 74 68 | 61 74 20 69 73 20 75 73 |block th|at is us|
|00001000| 65 64 20 69 6e 20 50 42 | 47 65 74 46 43 42 49 6e |ed in PB|GetFCBIn|
|00001010| 66 6f 20 63 61 6c 6c 73 | 2e 20 20 54 68 65 20 66 |fo calls|. The f|
|00001020| 69 65 6c 64 20 69 6f 46 | 43 42 49 6e 64 78 20 77 |ield ioF|CBIndx w|
|00001030| 61 73 20 69 6e 63 6f 72 | 72 65 63 74 6c 79 20 6c |as incor|rectly l|
|00001040| 69 73 74 65 64 20 61 73 | 20 61 20 4c 4f 4e 47 49 |isted as| a LONGI|
|00001050| 4e 54 2e 20 20 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |NT. The| followi|
|00001060| 6e 67 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 28 |ng decla|ration (|
|00001070| 66 6f 75 6e 64 20 69 6e | 20 49 6e 73 69 64 65 20 |found in| Inside |
|00001080| 4d 61 63 69 6e 74 6f 73 | 68 29 3a 0d 09 2e 2e 2e |Macintos|h):.....|
|00001090| 0d 09 69 6f 52 65 66 4e | 75 6d 3a 09 49 4e 54 45 |..ioRefN|um:.INTE|
|000010a0| 47 45 52 3b 0d 09 66 69 | 6c 6c 65 72 3a 09 49 4e |GER;..fi|ller:.IN|
|000010b0| 54 45 47 45 52 3b 0d 09 | 69 6f 46 43 42 49 6e 64 |TEGER;..|ioFCBInd|
|000010c0| 78 3a 09 4c 4f 4e 47 49 | 4e 54 3b 0d 09 69 6f 46 |x:.LONGI|NT;..ioF|
|000010d0| 43 42 46 6c 4e 6d 3a 20 | 09 4c 4f 4e 47 49 4e 54 |CBFlNm: |.LONGINT|
|000010e0| 3b 0d 09 2e 2e 2e 0d 73 | 68 6f 75 6c 64 20 62 65 |;......s|hould be|
|000010f0| 20 63 68 61 6e 67 65 64 | 20 74 6f 3a 0d 09 0d 09 | changed| to:....|
|00001100| 2e 2e 2e 0d 09 69 6f 52 | 65 66 4e 75 6d 3a 09 49 |.....ioR|efNum:.I|
|00001110| 4e 54 45 47 45 52 3b 0d | 09 66 69 6c 6c 65 72 3a |NTEGER;.|.filler:|
|00001120| 09 49 4e 54 45 47 45 52 | 3b 0d 09 69 6f 46 43 42 |.INTEGER|;..ioFCB|
|00001130| 49 6e 64 78 3a 09 49 4e | 54 45 47 45 52 3b 0d 09 |Indx:.IN|TEGER;..|
|00001140| 69 6f 46 43 42 46 69 6c | 6c 65 72 31 3a 09 49 4e |ioFCBFil|ler1:.IN|
|00001150| 54 45 47 45 52 3b 0d 09 | 69 6f 46 43 42 46 6c 4e |TEGER;..|ioFCBFlN|
|00001160| 6d 3a 09 4c 4f 4e 47 49 | 4e 54 3b 0d 09 2e 2e 2e |m:.LONGI|NT;.....|
|00001170| 0d 46 75 72 74 68 65 72 | 20 52 65 66 65 72 65 6e |.Further| Referen|
|00001180| 63 65 3a 0d a5 09 54 68 | 65 20 46 69 6c 65 20 4d |ce:...Th|e File M|
|00001190| 61 6e 61 67 65 72 0d 4e | 6f 74 69 63 65 3a 20 54 |anager.N|otice: T|
|000011a0| 68 65 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 69 |he infor|mation i|
|000011b0| 6e 20 74 68 69 73 20 54 | 65 63 68 6e 69 63 61 6c |n this T|echnical|
|000011c0| 20 4e 6f 74 65 20 63 61 | 6e 20 6e 6f 77 20 62 65 | Note ca|n now be|
|000011d0| 20 66 6f 75 6e 64 20 69 | 6e 20 49 6e 73 69 64 65 | found i|n Inside|
|000011e0| 20 4d 61 63 69 6e 74 6f | 73 68 3a 46 69 6c 65 73 | Macinto|sh:Files|
|000011f0| 20 70 61 67 65 20 32 2d | 34 34 2e 20 20 54 68 69 | page 2-|44. Thi|
|00001200| 73 20 6e 6f 74 65 20 77 | 69 6c 6c 20 62 65 20 72 |s note w|ill be r|
|00001210| 65 6d 6f 76 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |emoved f|rom the |
|00001220| 54 65 63 68 6e 69 63 61 | 6c 20 4e 6f 74 65 20 6c |Technica|l Note l|
|00001230| 69 62 72 61 72 79 20 69 | 6e 20 74 68 65 20 6e 65 |ibrary i|n the ne|
|00001240| 61 72 20 66 75 74 75 72 | 65 2e 0d 46 4c 20 34 20 |ar futur|e..FL 4 |
|00001250| 2d 20 47 65 74 74 69 6e | 67 20 61 20 46 75 6c 6c |- Gettin|g a Full|
|00001260| 20 50 61 74 68 6e 61 6d | 65 0d 46 69 6c 65 73 09 | Pathnam|e.Files.|
|00001270| 09 0d 52 65 76 69 73 65 | 64 20 62 79 3a 09 4b 65 |..Revise|d by:.Ke|
|00001280| 69 74 68 20 52 6f 6c 6c | 69 6e 09 4f 63 74 6f 62 |ith Roll|in.Octob|
|00001290| 65 72 20 31 39 38 39 0d | 57 72 69 74 74 65 6e 20 |er 1989.|Written |
|000012a0| 62 79 3a 09 4b 65 69 74 | 68 20 52 6f 6c 6c 69 6e |by:.Keit|h Rollin|
|000012b0| 09 4a 75 6e 65 20 31 39 | 38 39 0d 54 68 69 73 20 |.June 19|89.This |
|000012c0| 54 65 63 68 6e 69 63 61 | 6c 20 4e 6f 74 65 20 64 |Technica|l Note d|
|000012d0| 65 73 63 72 69 62 65 73 | 20 68 6f 77 20 74 6f 20 |escribes| how to |
|000012e0| 67 65 6e 65 72 61 74 65 | 20 61 20 66 75 6c 6c 20 |generate| a full |
|000012f0| 70 61 74 68 6e 61 6d 65 | 2c 20 67 69 76 65 6e 20 |pathname|, given |
|00001300| 65 69 74 68 65 72 20 61 | 20 57 6f 72 6b 69 6e 67 |either a| Working|
|00001310| 20 44 69 72 65 63 74 6f | 72 79 20 49 44 20 6f 72 | Directo|ry ID or|
|00001320| 20 61 20 72 65 61 6c 20 | 76 52 65 66 4e 75 6d 20 | a real |vRefNum |
|00001330| 61 6e 64 20 61 20 44 69 | 72 49 44 2e 20 42 79 20 |and a Di|rID. By |
|00001340| 75 73 69 6e 67 20 74 68 | 65 20 74 65 63 68 6e 69 |using th|e techni|
|00001350| 71 75 65 73 20 73 68 6f | 77 6e 20 69 6e 20 74 68 |ques sho|wn in th|
|00001360| 69 73 20 4e 6f 74 65 2c | 20 79 6f 75 20 63 61 6e |is Note,| you can|
|00001370| 20 66 69 6e 64 20 74 68 | 65 20 66 75 6c 6c 20 70 | find th|e full p|
|00001380| 61 74 68 6e 61 6d 65 20 | 66 72 6f 6d 20 69 6e 66 |athname |from inf|
|00001390| 6f 72 6d 61 74 69 6f 6e | 20 73 75 63 68 20 61 73 |ormation| such as|
|000013a0| 20 74 68 61 74 20 72 65 | 74 75 72 6e 65 64 20 62 | that re|turned b|
|000013b0| 79 20 53 74 61 6e 64 61 | 72 64 20 46 69 6c 65 2e |y Standa|rd File.|
|000013c0| 0d 43 68 61 6e 67 65 73 | 20 73 69 6e 63 65 20 4a |.Changes| since J|
|000013d0| 75 6e 65 20 38 39 3a 20 | 20 41 64 64 65 64 20 61 |une 89: | Added a|
|000013e0| 20 6e 6f 74 65 20 6f 6e | 20 68 6f 77 20 74 6f 20 | note on| how to |
|000013f0| 63 68 65 63 6b 20 66 6f | 72 20 41 2f 55 58 2e 20 |check fo|r A/UX. |
|00001400| 20 46 69 78 65 64 20 62 | 75 67 20 69 6e 20 43 20 | Fixed b|ug in C |
|00001410| 76 65 72 73 69 6f 6e 3a | 20 20 42 6c 6f 63 6b 4d |version:| BlockM|
|00001420| 6f 76 65 28 29 20 70 61 | 72 61 6d 65 74 65 72 73 |ove() pa|rameters|
|00001430| 20 77 65 72 65 20 72 65 | 76 65 72 73 65 64 20 69 | were re|versed i|
|00001440| 6e 20 70 53 74 72 63 70 | 79 28 29 3b 20 61 64 64 |n pStrcp|y(); add|
|00001450| 65 64 20 72 61 6e 67 65 | 20 63 68 65 63 6b 69 6e |ed range| checkin|
|00001460| 67 20 74 6f 20 70 53 74 | 72 43 61 74 28 29 3b 20 |g to pSt|rCat(); |
|00001470| 63 68 61 6e 67 65 64 20 | 72 65 66 65 72 65 6e 63 |changed |referenc|
|00001480| 65 73 20 66 72 6f 6d 20 | d2 6c 6f 6e 67 69 6e 74 |es from |.longint|
|00001490| d3 20 74 6f 20 d2 6c 6f | 6e 67 d3 2e 20 20 46 69 |. to .lo|ng.. Fi|
|000014a0| 78 65 64 20 62 75 67 20 | 69 6e 20 50 61 73 63 61 |xed bug |in Pasca|
|000014b0| 6c 20 61 6e 64 20 43 20 | 76 65 72 73 69 6f 6e 73 |l and C |versions|
|000014c0| 3a 20 20 43 68 61 6e 67 | 65 64 20 66 73 52 74 44 |: Chang|ed fsRtD|
|000014d0| 69 72 20 74 6f 20 66 73 | 52 74 64 69 72 49 44 20 |ir to fs|RtdirID |
|000014e0| 61 6e 64 20 6d 61 64 65 | 20 72 65 66 65 72 65 6e |and made| referen|
|000014f0| 63 65 73 20 74 6f 20 67 | 48 61 76 65 41 55 58 20 |ces to g|HaveAUX |
|00001500| 63 6f 6e 73 69 73 74 65 | 6e 74 2e 0d 54 68 69 73 |consiste|nt..This|
|00001510| 20 4e 6f 74 65 20 70 72 | 65 73 65 6e 74 73 20 74 | Note pr|esents t|
|00001520| 77 6f 20 72 6f 75 74 69 | 6e 65 73 2e 20 20 54 68 |wo routi|nes. Th|
|00001530| 65 20 66 69 72 73 74 20 | 72 6f 75 74 69 6e 65 20 |e first |routine |
|00001540| 69 73 20 63 61 6c 6c 65 | 64 20 50 61 74 68 4e 61 |is calle|d PathNa|
|00001550| 6d 65 46 72 6f 6d 57 44 | 2e 20 20 49 74 20 74 61 |meFromWD|. It ta|
|00001560| 6b 65 73 20 61 6e 20 48 | 46 53 20 57 6f 72 6b 69 |kes an H|FS Worki|
|00001570| 6e 67 20 44 69 72 65 63 | 74 6f 72 79 20 49 44 20 |ng Direc|tory ID |
|00001580| 61 6e 64 20 72 65 74 75 | 72 6e 73 20 74 68 65 20 |and retu|rns the |
|00001590| 66 75 6c 6c 20 70 61 74 | 68 6e 61 6d 65 20 74 68 |full pat|hname th|
|000015a0| 61 74 20 63 6f 72 72 65 | 73 70 6f 6e 64 73 20 74 |at corre|sponds t|
|000015b0| 6f 20 69 74 2e 20 20 49 | 74 20 64 6f 65 73 20 74 |o it. I|t does t|
|000015c0| 68 69 73 20 62 79 20 63 | 61 6c 6c 69 6e 67 20 5f |his by c|alling _|
|000015d0| 50 42 47 65 74 57 44 49 | 6e 66 6f 20 74 6f 20 67 |PBGetWDI|nfo to g|
|000015e0| 65 74 20 74 68 65 20 76 | 52 65 66 4e 75 6d 20 61 |et the v|RefNum a|
|000015f0| 6e 64 20 44 69 72 49 44 | 20 6f 66 20 74 68 65 20 |nd DirID| of the |
|00001600| 72 65 61 6c 20 64 69 72 | 65 63 74 6f 72 79 2e 20 |real dir|ectory. |
|00001610| 20 49 74 20 74 68 65 6e | 20 63 61 6c 6c 73 20 50 | It then| calls P|
|00001620| 61 74 68 4e 61 6d 65 46 | 72 6f 6d 44 69 72 49 44 |athNameF|romDirID|
|00001630| 20 61 6e 64 20 72 65 74 | 75 72 6e 73 20 69 74 73 | and ret|urns its|
|00001640| 20 72 65 73 75 6c 74 2e | 0d 50 61 74 68 4e 61 6d | result.|.PathNam|
|00001650| 65 46 72 6f 6d 44 69 72 | 49 44 20 74 61 6b 65 73 |eFromDir|ID takes|
|00001660| 20 61 20 72 65 61 6c 20 | 76 52 65 66 4e 75 6d 20 | a real |vRefNum |
|00001670| 61 6e 64 20 61 20 44 69 | 72 49 44 20 61 6e 64 20 |and a Di|rID and |
|00001680| 72 65 74 75 72 6e 73 20 | 74 68 65 20 66 75 6c 6c |returns |the full|
|00001690| 20 70 61 74 68 6e 61 6d | 65 20 74 68 61 74 20 63 | pathnam|e that c|
|000016a0| 6f 72 72 65 73 70 6f 6e | 64 73 20 74 6f 20 69 74 |orrespon|ds to it|
|000016b0| 2e 20 20 49 74 20 64 6f | 65 73 20 74 68 69 73 20 |. It do|es this |
|000016c0| 62 79 20 63 61 6c 6c 69 | 6e 67 20 5f 50 42 47 65 |by calli|ng _PBGe|
|000016d0| 74 43 61 74 49 6e 66 6f | 20 66 6f 72 20 74 68 65 |tCatInfo| for the|
|000016e0| 20 67 69 76 65 6e 20 64 | 69 72 65 63 74 6f 72 79 | given d|irectory|
|000016f0| 20 61 6e 64 20 66 69 6e | 64 69 6e 67 20 6f 75 74 | and fin|ding out|
|00001700| 20 69 74 73 20 6e 61 6d | 65 20 61 6e 64 20 74 68 | its nam|e and th|
|00001710| 65 20 44 69 72 49 44 20 | 6f 66 20 69 74 73 20 70 |e DirID |of its p|
|00001720| 61 72 65 6e 74 2e 20 20 | 49 74 20 74 68 65 6e 20 |arent. |It then |
|00001730| 70 65 72 66 6f 72 6d 73 | 20 74 68 65 20 73 61 6d |performs| the sam|
|00001740| 65 20 6f 70 65 72 61 74 | 69 6f 6e 20 6f 6e 20 74 |e operat|ion on t|
|00001750| 68 65 20 70 61 72 65 6e | 74 2c 20 73 74 69 63 6b |he paren|t, stick|
|00001760| 69 6e 67 20 69 74 73 20 | 6e 61 6d 65 20 6f 6e 74 |ing its |name ont|
|00001770| 6f 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |o the be|ginning |
|00001780| 6f 66 20 74 68 65 20 66 | 69 72 73 74 20 64 69 72 |of the f|irst dir|
|00001790| 65 63 74 6f 72 79 2e 20 | 20 54 68 69 73 20 77 68 |ectory. | This wh|
|000017a0| 6f 6c 65 20 70 72 6f 63 | 65 73 73 20 69 73 20 63 |ole proc|ess is c|
|000017b0| 6f 6e 74 69 6e 75 65 64 | 20 75 6e 74 69 6c 20 77 |ontinued| until w|
|000017c0| 65 20 68 61 76 65 20 70 | 72 6f 63 65 73 73 65 64 |e have p|rocessed|
|000017d0| 20 65 76 65 72 79 74 68 | 69 6e 67 20 75 70 20 74 | everyth|ing up t|
|000017e0| 6f 20 74 68 65 20 72 6f | 6f 74 20 64 69 72 65 63 |o the ro|ot direc|
|000017f0| 74 6f 72 79 20 28 69 64 | 65 6e 74 69 66 69 65 64 |tory (id|entified|
|00001800| 20 77 69 74 68 20 61 20 | 44 69 72 49 44 20 6f 66 | with a |DirID of|
|00001810| 20 32 29 2e 0d 57 61 72 | 6e 69 6e 67 0d 54 68 69 | 2)..War|ning.Thi|
|00001820| 73 20 4e 6f 74 65 20 69 | 73 20 62 65 69 6e 67 20 |s Note i|s being |
|00001830| 72 65 6c 65 61 73 65 64 | 20 69 6e 20 72 65 73 70 |released| in resp|
|00001840| 6f 6e 73 65 20 74 6f 20 | 64 65 6d 61 6e 64 20 66 |onse to |demand f|
|00001850| 72 6f 6d 20 64 65 76 65 | 6c 6f 70 65 72 73 2e 20 |rom deve|lopers. |
|00001860| 20 48 6f 77 65 76 65 72 | 2c 20 66 6f 72 20 74 68 | However|, for th|
|00001870| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 72 65 61 73 |e follow|ing reas|
|00001880| 6f 6e 73 2c 20 67 65 6e | 65 72 61 74 69 6e 67 20 |ons, gen|erating |
|00001890| 66 75 6c 6c 20 70 61 74 | 68 6e 61 6d 65 73 20 69 |full pat|hnames i|
|000018a0| 73 20 68 69 67 68 6c 79 | 20 64 69 73 63 6f 75 72 |s highly| discour|
|000018b0| 61 67 65 64 3a 0d a5 09 | 50 72 6f 62 6c 65 6d 73 |aged:...|Problems|
|000018c0| 20 61 72 69 73 65 20 77 | 68 65 6e 20 61 63 63 65 | arise w|hen acce|
|000018d0| 73 73 69 6e 67 20 76 6f | 6c 75 6d 65 73 20 74 68 |ssing vo|lumes th|
|000018e0| 61 74 20 75 73 65 20 66 | 69 6c 65 20 73 79 73 74 |at use f|ile syst|
|000018f0| 65 6d 73 20 6f 74 68 65 | 72 20 74 68 61 6e 20 48 |ems othe|r than H|
|00001900| 46 53 2e 20 20 46 6f 72 | 20 69 6e 73 74 61 6e 63 |FS. For| instanc|
|00001910| 65 2c 20 50 61 74 68 4e | 61 6d 65 46 72 6f 6d 44 |e, PathN|ameFromD|
|00001920| 69 72 49 44 20 75 73 65 | 73 20 61 20 62 75 74 63 |irID use|s a butc|
|00001930| 68 65 72 6f 75 73 20 68 | 61 63 6b 20 74 6f 20 62 |herous h|ack to b|
|00001940| 65 20 41 2f 55 58 20 66 | 72 69 65 6e 64 6c 79 2e |e A/UX f|riendly.|
|00001950| 20 20 20 41 2f 55 58 20 | 6c 69 6b 65 73 20 73 75 | A/UX |likes su|
|00001960| 62 64 69 72 65 63 74 6f | 72 69 65 73 20 73 65 70 |bdirecto|ries sep|
|00001970| 61 72 61 74 65 64 20 62 | 79 20 73 6c 61 73 68 65 |arated b|y slashe|
|00001980| 73 20 69 6e 20 61 20 70 | 61 74 68 6e 61 6d 65 2c |s in a p|athname,|
|00001990| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 63 6f 6c | rather |than col|
|000019a0| 6f 6e 73 2e 20 20 54 68 | 69 73 20 72 6f 75 74 69 |ons. Th|is routi|
|000019b0| 6e 65 20 61 75 74 6f 6d | 61 74 69 63 61 6c 6c 79 |ne autom|atically|
|000019c0| 20 75 73 65 73 20 63 6f | 6c 6f 6e 73 20 6f 72 20 | uses co|lons or |
|000019d0| 73 6c 61 73 68 65 73 20 | 61 73 20 73 65 70 61 72 |slashes |as separ|
|000019e0| 61 74 6f 72 73 20 62 61 | 73 65 64 20 6f 6e 20 74 |ators ba|sed on t|
|000019f0| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 67 48 61 76 |he value| of gHav|
|00001a00| 65 41 55 58 2e 20 20 54 | 6f 20 63 68 65 63 6b 20 |eAUX. T|o check |
|00001a10| 66 6f 72 20 74 68 65 20 | 70 72 65 73 65 6e 63 65 |for the |presence|
|00001a20| 20 6f 66 20 41 2f 55 58 | 2c 20 65 78 61 6d 69 6e | of A/UX|, examin|
|00001a30| 65 20 62 69 74 20 39 20 | 6f 66 20 48 57 43 66 67 |e bit 9 |of HWCfg|
|00001a40| 46 6c 61 67 73 2e 20 20 | 49 66 20 69 74 20 69 73 |Flags. |If it is|
|00001a50| 20 73 65 74 2c 20 79 6f | 75 20 61 72 65 20 72 75 | set, yo|u are ru|
|00001a60| 6e 6e 69 6e 67 20 75 6e | 64 65 72 20 41 2f 55 58 |nning un|der A/UX|
|00001a70| 2e 20 20 54 68 69 73 20 | 67 6c 6f 62 61 6c 20 6d |. This |global m|
|00001a80| 75 73 74 20 62 65 20 69 | 6e 69 74 69 61 6c 69 7a |ust be i|nitializ|
|00001a90| 65 64 20 63 6f 72 72 65 | 63 74 6c 79 20 66 6f 72 |ed corre|ctly for|
|00001aa0| 20 74 68 69 73 20 72 6f | 75 74 69 6e 65 20 74 6f | this ro|utine to|
|00001ab0| 20 64 6f 20 69 74 73 20 | 74 68 69 6e 67 2e 20 20 | do its |thing. |
|00001ac0| 48 6f 77 65 76 65 72 2c | 20 62 65 63 61 75 73 65 |However,| because|
|00001ad0| 20 6f 66 20 74 68 69 73 | 20 64 65 70 65 6e 64 65 | of this| depende|
|00001ae0| 6e 63 79 20 6f 6e 20 74 | 68 65 20 69 64 69 6f 73 |ncy on t|he idios|
|00001af0| 79 6e 63 72 61 73 69 65 | 73 20 6f 66 20 66 69 6c |yncrasie|s of fil|
|00001b00| 65 20 73 79 73 74 65 6d | 73 2c 20 67 65 6e 65 72 |e system|s, gener|
|00001b10| 61 74 69 6e 67 20 66 75 | 6c 6c 20 70 61 74 68 6e |ating fu|ll pathn|
|00001b20| 61 6d 65 73 20 66 6f 72 | 20 6f 74 68 65 72 20 74 |ames for| other t|
|00001b30| 68 61 6e 20 64 69 73 70 | 6c 61 79 20 70 75 72 70 |han disp|lay purp|
|00001b40| 6f 73 65 73 20 69 73 20 | 64 69 73 63 6f 75 72 61 |oses is |discoura|
|00001b50| 67 65 64 3b 20 69 74 20 | 63 68 61 6e 67 65 64 20 |ged; it |changed |
|00001b60| 69 6e 20 74 68 65 20 70 | 61 73 74 20 77 68 65 6e |in the p|ast when|
|00001b70| 20 41 2f 55 58 20 77 61 | 73 20 69 6d 70 6c 65 6d | A/UX wa|s implem|
|00001b80| 65 6e 74 65 64 2c 20 61 | 6e 64 20 69 74 20 6d 61 |ented, a|nd it ma|
|00001b90| 79 20 63 68 61 6e 67 65 | 20 61 67 61 69 6e 20 69 |y change| again i|
|00001ba0| 6e 20 74 68 65 20 66 75 | 74 75 72 65 20 74 6f 20 |n the fu|ture to |
|00001bb0| 73 75 70 70 6f 72 74 20 | 6f 74 68 65 72 20 66 69 |support |other fi|
|00001bc0| 6c 65 20 73 79 73 74 65 | 6d 73 20 73 75 63 68 20 |le syste|ms such |
|00001bd0| 61 73 20 50 72 6f 44 4f | 53 2c 20 4d 53 2d 44 4f |as ProDO|S, MS-DO|
|00001be0| 53 2c 20 6f 72 20 4f 53 | 2f 32 2e 0d a5 09 4f 6e |S, or OS|/2....On|
|00001bf0| 65 20 72 65 61 73 6f 6e | 20 64 65 76 65 6c 6f 70 |e reason| develop|
|00001c00| 65 72 73 20 68 61 76 65 | 20 73 74 61 74 65 64 20 |ers have| stated |
|00001c10| 66 6f 72 20 6e 65 65 64 | 69 6e 67 20 74 6f 20 6b |for need|ing to k|
|00001c20| 6e 6f 77 20 74 68 65 20 | 66 75 6c 6c 20 70 61 74 |now the |full pat|
|00001c30| 68 6e 61 6d 65 20 66 6f | 72 20 69 73 20 73 6f 20 |hname fo|r is so |
|00001c40| 74 68 61 74 20 74 68 65 | 79 20 63 61 6e 20 72 65 |that the|y can re|
|00001c50| 6d 65 6d 62 65 72 20 74 | 68 65 20 6c 6f 63 61 74 |member t|he locat|
|00001c60| 69 6f 6e 20 6f 66 20 61 | 20 70 61 72 74 69 63 75 |ion of a| particu|
|00001c70| 6c 61 72 20 66 69 6c 65 | 2e 20 20 53 61 76 69 6e |lar file|. Savin|
|00001c80| 67 20 61 20 66 69 6c 65 | d5 73 20 66 75 6c 6c 20 |g a file|.s full |
|00001c90| 70 61 74 68 6e 61 6d 65 | 20 73 68 6f 75 6c 64 20 |pathname| should |
|00001ca0| 6f 6e 6c 79 20 62 65 20 | 75 73 65 64 20 61 73 20 |only be |used as |
|00001cb0| 61 20 6c 61 73 74 20 72 | 65 73 6f 72 74 2e 20 20 |a last r|esort. |
|00001cc0| 49 6e 73 74 65 61 64 2c | 20 79 6f 75 20 73 68 6f |Instead,| you sho|
|00001cd0| 75 6c 64 20 72 65 6d 65 | 6d 62 65 72 20 74 68 65 |uld reme|mber the|
|00001ce0| 20 44 69 72 49 44 20 6f | 66 20 74 68 65 20 64 69 | DirID o|f the di|
|00001cf0| 72 65 63 74 6f 72 79 20 | 74 68 65 20 66 69 6c 65 |rectory |the file|
|00001d00| 20 69 73 20 69 6e 20 61 | 6c 6f 6e 67 20 77 69 74 | is in a|long wit|
|00001d10| 68 20 69 74 d5 73 20 6e | 61 6d 65 2e 20 20 54 68 |h it.s n|ame. Th|
|00001d20| 69 73 20 77 61 79 2c 20 | 79 6f 75 20 77 69 6c 6c |is way, |you will|
|00001d30| 20 73 74 69 6c 6c 20 62 | 65 20 61 62 6c 65 20 74 | still b|e able t|
|00001d40| 6f 20 66 69 6e 64 20 79 | 6f 75 72 20 66 69 6c 65 |o find y|our file|
|00001d50| 20 65 76 65 6e 20 69 66 | 20 74 68 65 20 64 69 72 | even if| the dir|
|00001d60| 65 63 74 6f 72 79 20 68 | 61 73 20 62 65 65 6e 20 |ectory h|as been |
|00001d70| 6d 6f 76 65 64 2e 20 20 | 55 6e 64 65 72 20 53 79 |moved. |Under Sy|
|00001d80| 73 74 65 6d 20 37 2e 30 | 20 6f 72 20 6c 61 74 65 |stem 7.0| or late|
|00001d90| 72 2c 20 73 61 76 65 20 | 74 68 65 20 66 69 6c 65 |r, save |the file|
|00001da0| d5 73 20 75 6e 69 71 75 | 65 20 33 32 2d 62 69 74 |.s uniqu|e 32-bit|
|00001db0| 20 49 44 20 6e 75 6d 62 | 65 72 20 61 73 20 77 65 | ID numb|er as we|
|00001dc0| 6c 6c 2c 20 73 6f 20 74 | 68 61 74 20 79 6f 75 20 |ll, so t|hat you |
|00001dd0| 63 61 6e 20 61 6c 73 6f | 20 66 69 6e 64 20 74 68 |can also| find th|
|00001de0| 65 20 66 69 6c 65 20 65 | 76 65 6e 20 69 66 20 69 |e file e|ven if i|
|00001df0| 74 d5 73 20 6e 61 6d 65 | 20 68 61 73 20 63 68 61 |t.s name| has cha|
|00001e00| 6e 67 65 64 2e 0d 09 45 | 69 74 68 65 72 20 6f 66 |nged...E|ither of|
|00001e10| 20 74 68 65 73 65 20 6d | 65 74 68 6f 64 73 20 6d | these m|ethods m|
|00001e20| 61 79 20 66 61 69 6c 20 | 69 66 20 61 20 76 6f 6c |ay fail |if a vol|
|00001e30| 75 6d 65 20 68 61 73 20 | 62 65 65 6e 20 72 65 73 |ume has |been res|
|00001e40| 74 6f 72 65 64 20 66 72 | 6f 6d 20 61 20 62 61 63 |tored fr|om a bac|
|00001e50| 6b 75 70 2e 20 20 49 6e | 20 74 68 61 74 20 63 61 |kup. In| that ca|
|00001e60| 73 65 2c 20 79 6f 75 20 | 6d 69 67 68 74 20 62 65 |se, you |might be|
|00001e70| 20 61 62 6c 65 20 74 6f | 20 66 69 6e 64 20 74 68 | able to| find th|
|00001e80| 65 20 66 69 6c 65 20 62 | 79 20 73 65 61 72 63 68 |e file b|y search|
|00001e90| 69 6e 67 20 77 69 74 68 | 20 69 74 73 20 66 75 6c |ing with| its ful|
|00001ea0| 6c 20 70 61 74 68 6e 61 | 6d 65 2e 20 20 49 66 20 |l pathna|me. If |
|00001eb0| 79 6f 75 20 66 69 6e 64 | 20 74 68 65 20 66 69 6c |you find| the fil|
|00001ec0| 65 2c 20 6e 6f 74 65 20 | 61 67 61 69 6e 20 74 68 |e, note |again th|
|00001ed0| 65 20 44 69 72 49 44 20 | 6f 66 20 74 68 65 20 64 |e DirID |of the d|
|00001ee0| 69 72 65 63 74 6f 72 79 | 20 69 74 20 69 73 20 69 |irectory| it is i|
|00001ef0| 6e 2c 20 61 6e 64 20 73 | 61 76 65 20 69 74 20 66 |n, and s|ave it f|
|00001f00| 6f 72 20 66 75 74 75 72 | 65 20 75 73 65 2e 20 20 |or futur|e use. |
|00001f10| 49 66 20 72 75 6e 6e 69 | 6e 67 20 75 6e 64 65 72 |If runni|ng under|
|00001f20| 20 37 2e 30 20 6f 72 20 | 6c 61 74 65 72 2c 20 61 | 7.0 or |later, a|
|00001f30| 6c 73 6f 20 6e 6f 74 65 | 20 74 68 65 20 66 69 6c |lso note| the fil|
|00001f40| 65 d5 73 20 49 44 20 6e | 75 6d 62 65 72 2e 0d a5 |e.s ID n|umber...|
|00001f50| 09 54 68 65 20 72 6f 75 | 74 69 6e 65 73 20 62 65 |.The rou|tines be|
|00001f60| 6c 6f 77 20 61 72 65 20 | 77 72 69 74 74 65 6e 20 |low are |written |
|00001f70| 74 6f 20 72 65 74 75 72 | 6e 20 50 61 73 63 61 6c |to retur|n Pascal|
|00001f80| 20 73 74 72 69 6e 67 73 | 20 28 61 20 6c 65 6e 67 | strings| (a leng|
|00001f90| 74 68 20 62 79 74 65 20 | 66 6f 6c 6c 6f 77 65 64 |th byte |followed|
|00001fa0| 20 62 79 20 74 68 65 20 | 41 53 43 49 49 20 63 68 | by the |ASCII ch|
|00001fb0| 61 72 61 63 74 65 72 73 | 29 2e 20 20 48 65 6e 63 |aracters|). Henc|
|00001fc0| 65 2c 20 74 68 65 20 6c | 69 6d 69 74 20 6f 6e 20 |e, the l|imit on |
|00001fd0| 74 68 65 20 6c 65 6e 67 | 74 68 20 6f 66 20 61 20 |the leng|th of a |
|00001fe0| 50 61 73 63 61 6c 20 73 | 74 72 69 6e 67 20 69 73 |Pascal s|tring is|
|00001ff0| 20 32 35 35 20 63 68 61 | 72 61 63 74 65 72 73 2e | 255 cha|racters.|
|00002000| 20 20 48 6f 77 65 76 65 | 72 2c 20 61 20 66 69 6c | Howeve|r, a fil|
|00002010| 65 d5 73 20 66 75 6c 6c | 20 70 61 74 68 6e 61 6d |e.s full| pathnam|
|00002020| 65 20 6d 61 79 20 62 65 | 20 6c 6f 6e 67 65 72 20 |e may be| longer |
|00002030| 74 68 61 6e 20 32 35 35 | 20 63 68 61 72 61 63 74 |than 255| charact|
|00002040| 65 72 73 2e 20 20 41 6e | 79 20 72 6f 75 74 69 6e |ers. An|y routin|
|00002050| 65 20 79 6f 75 20 77 72 | 69 74 65 20 73 68 6f 75 |e you wr|ite shou|
|00002060| 6c 64 20 62 65 20 70 72 | 65 70 61 72 65 64 20 66 |ld be pr|epared f|
|00002070| 6f 72 20 74 68 69 73 20 | 63 6f 6e 74 69 6e 67 65 |or this |continge|
|00002080| 6e 63 79 2e 0d a5 09 54 | 68 65 20 72 65 61 73 6f |ncy....T|he reaso|
|00002090| 6e 20 77 68 79 20 74 68 | 65 20 73 61 6d 70 6c 65 |n why th|e sample|
|000020a0| 20 72 6f 75 74 69 6e 65 | 73 20 62 65 6c 6f 77 20 | routine|s below |
|000020b0| 77 65 72 65 20 77 72 69 | 74 74 65 6e 20 74 6f 20 |were wri|tten to |
|000020c0| 72 65 74 75 72 6e 20 50 | 61 73 63 61 6c 20 73 74 |return P|ascal st|
|000020d0| 72 69 6e 67 73 20 69 73 | 20 62 65 63 61 75 73 65 |rings is| because|
|000020e0| 20 74 68 61 74 d5 73 20 | 74 68 65 20 77 61 79 20 | that.s |the way |
|000020f0| 74 68 65 20 46 69 6c 65 | 20 4d 61 6e 61 67 65 72 |the File| Manager|
|00002100| 20 6c 69 6b 65 73 20 74 | 68 65 6d 2e 20 20 48 6f | likes t|hem. Ho|
|00002110| 77 65 76 65 72 2c 20 61 | 73 20 79 6f 75 20 6e 6f |wever, a|s you no|
|00002120| 77 20 6b 6e 6f 77 2c 20 | 61 20 66 69 6c 65 d5 73 |w know, |a file.s|
|00002130| 20 66 75 6c 6c 20 70 61 | 74 68 6e 61 6d 65 20 6d | full pa|thname m|
|00002140| 61 79 20 62 65 20 6c 6f | 6e 67 65 72 20 74 68 61 |ay be lo|nger tha|
|00002150| 6e 20 74 68 61 74 20 61 | 63 63 65 70 74 61 62 6c |n that a|cceptabl|
|00002160| 65 20 74 6f 20 74 68 65 | 20 46 69 6c 65 20 4d 61 |e to the| File Ma|
|00002170| 6e 61 67 65 72 2e 20 20 | 54 68 65 72 65 66 6f 72 |nager. |Therefor|
|00002180| 65 2c 20 65 76 65 6e 20 | 69 66 20 79 6f 75 20 64 |e, even |if you d|
|00002190| 6f 20 67 65 74 20 66 61 | 6e 63 79 20 61 6e 64 20 |o get fa|ncy and |
|000021a0| 75 73 65 20 74 68 69 6e | 67 73 20 6c 69 6b 65 20 |use thin|gs like |
|000021b0| 68 61 6e 64 6c 65 73 20 | 61 6e 64 20 4d 75 6e 67 |handles |and Mung|
|000021c0| 65 72 20 74 6f 20 63 72 | 65 61 74 65 20 61 20 6d |er to cr|eate a m|
|000021d0| 6f 6e 64 6f d0 6c 65 6e | 67 74 68 20 66 69 6c 65 |ondo.len|gth file|
|000021e0| 6e 61 6d 65 2c 20 79 6f | 75 20 77 69 6c 6c 20 73 |name, yo|u will s|
|000021f0| 74 69 6c 6c 20 68 61 76 | 65 20 74 6f 20 70 61 72 |till hav|e to par|
|00002200| 73 65 20 69 74 20 69 6e | 74 6f 20 70 69 65 63 65 |se it in|to piece|
|00002210| 73 20 6c 65 73 73 20 74 | 68 61 6e 20 32 35 35 20 |s less t|han 255 |
|00002220| 62 79 74 65 73 20 66 6f | 72 20 74 68 65 20 46 69 |bytes fo|r the Fi|
|00002230| 6c 65 20 4d 61 6e 61 67 | 65 72 20 74 6f 20 68 61 |le Manag|er to ha|
|00002240| 6e 64 6c 65 2e 20 20 53 | 69 6d 70 6c 79 20 75 73 |ndle. S|imply us|
|00002250| 69 6e 67 20 61 20 44 69 | 72 49 44 20 69 73 20 61 |ing a Di|rID is a|
|00002260| 20 6c 6f 74 20 65 61 73 | 69 65 72 2e 0d a5 09 54 | lot eas|ier....T|
|00002270| 68 65 73 65 20 72 6f 75 | 74 69 6e 65 73 20 61 73 |hese rou|tines as|
|00002280| 73 75 6d 65 20 74 68 65 | 20 65 78 69 73 74 65 6e |sume the| existen|
|00002290| 63 65 20 6f 66 20 48 46 | 53 2e 20 20 49 66 20 79 |ce of HF|S. If y|
|000022a0| 6f 75 20 69 6e 74 65 6e | 64 20 66 6f 72 20 79 6f |ou inten|d for yo|
|000022b0| 75 72 20 70 72 6f 67 72 | 61 6d 20 74 6f 20 72 75 |ur progr|am to ru|
|000022c0| 6e 20 75 6e 64 65 72 20 | 4d 46 53 2c 20 74 68 65 |n under |MFS, the|
|000022d0| 6e 20 79 6f 75 20 73 68 | 6f 75 6c 64 20 6d 61 6b |n you sh|ould mak|
|000022e0| 65 20 74 68 65 20 61 70 | 70 72 6f 70 72 69 61 74 |e the ap|propriat|
|000022f0| 65 20 63 68 65 63 6b 73 | 20 61 6e 64 20 77 72 69 |e checks| and wri|
|00002300| 74 65 20 73 70 65 63 69 | 61 6c 20 63 61 73 65 73 |te speci|al cases|
|00002310| 20 61 63 63 6f 72 64 69 | 6e 67 6c 79 2e 0d 4d 50 | accordi|ngly..MP|
|00002320| 57 20 50 61 73 63 61 6c | 0d 28 2a 2a 20 50 61 74 |W Pascal|.(** Pat|
|00002330| 68 4e 61 6d 65 46 72 6f | 6d 44 69 72 49 44 20 2a |hNameFro|mDirID *|
|00002340| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002350| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002370| 2a 2a 2a 2a 2a 2a 2a 2a | 29 0d 09 46 55 4e 43 54 |********|)..FUNCT|
|00002380| 49 4f 4e 20 50 61 74 68 | 4e 61 6d 65 46 72 6f 6d |ION Path|NameFrom|
|00002390| 44 69 72 49 44 28 44 69 | 72 49 44 3a 20 6c 6f 6e |DirID(Di|rID: lon|
|000023a0| 67 69 6e 74 3b 20 76 52 | 65 66 4e 75 6d 3a 20 69 |gint; vR|efNum: i|
|000023b0| 6e 74 65 67 65 72 29 3a | 20 73 74 72 32 35 35 3b |nteger):| str255;|
|000023c0| 0d 09 09 56 41 52 0d 09 | 09 09 42 6c 6f 63 6b 3a |...VAR..|..Block:|
|000023d0| 20 43 49 6e 66 6f 50 42 | 52 65 63 3b 0d 09 09 09 | CInfoPB|Rec;....|
|000023e0| 64 69 72 65 63 74 6f 72 | 79 4e 61 6d 65 2c 46 75 |director|yName,Fu|
|000023f0| 6c 6c 50 61 74 68 4e 61 | 6d 65 3a 20 73 74 72 32 |llPathNa|me: str2|
|00002400| 35 35 3b 0d 09 09 42 45 | 47 49 4e 0d 09 09 09 46 |55;...BE|GIN....F|
|00002410| 75 6c 6c 50 61 74 68 4e | 61 6d 65 3a 3d 27 27 3b |ullPathN|ame:='';|
|00002420| 0d 09 09 09 57 49 54 48 | 20 42 6c 6f 63 6b 20 44 |....WITH| Block D|
|00002430| 4f 20 42 45 47 49 4e 0d | 09 09 09 09 69 6f 4e 61 |O BEGIN.|....ioNa|
|00002440| 6d 65 50 74 72 3a 3d 40 | 64 69 72 65 63 74 6f 72 |mePtr:=@|director|
|00002450| 79 4e 61 6d 65 3b 0d 09 | 09 09 09 69 6f 44 72 50 |yName;..|...ioDrP|
|00002460| 61 72 49 44 3a 3d 44 69 | 72 49 44 3b 0d 09 09 09 |arID:=Di|rID;....|
|00002470| 45 4e 44 3b 0d 09 09 09 | 52 45 50 45 41 54 0d 09 |END;....|REPEAT..|
|00002480| 09 09 09 57 49 54 48 20 | 42 6c 6f 63 6b 20 44 4f |...WITH |Block DO|
|00002490| 20 42 45 47 49 4e 0d 09 | 09 09 09 09 69 6f 56 52 | BEGIN..|....ioVR|
|000024a0| 65 66 4e 75 6d 3a 3d 76 | 52 65 66 4e 75 6d 3b 0d |efNum:=v|RefNum;.|
|000024b0| 09 09 09 09 09 69 6f 46 | 44 69 72 49 6e 64 65 78 |.....ioF|DirIndex|
|000024c0| 3a 3d 2d 31 3b 0d 09 09 | 09 09 09 69 6f 44 72 44 |:=-1;...|...ioDrD|
|000024d0| 69 72 49 44 3a 3d 42 6c | 6f 63 6b 2e 69 6f 44 72 |irID:=Bl|ock.ioDr|
|000024e0| 50 61 72 49 44 3b 0d 09 | 09 09 09 45 4e 44 3b 0d |ParID;..|...END;.|
|000024f0| 09 09 09 09 65 72 72 3a | 3d 50 42 47 65 74 43 61 |....err:|=PBGetCa|
|00002500| 74 49 6e 66 6f 28 40 42 | 6c 6f 63 6b 2c 46 41 4c |tInfo(@B|lock,FAL|
|00002510| 53 45 29 3b 0d 09 09 09 | 09 49 46 20 67 48 61 76 |SE);....|.IF gHav|
|00002520| 65 41 55 58 20 54 48 45 | 4e 20 42 45 47 49 4e 0d |eAUX THE|N BEGIN.|
|00002530| 09 09 09 09 09 49 46 20 | 64 69 72 65 63 74 6f 72 |.....IF |director|
|00002540| 79 4e 61 6d 65 5b 31 5d | 3c 3e 27 2f 27 20 54 48 |yName[1]|<>'/' TH|
|00002550| 45 4e 20 42 45 47 49 4e | 0d 09 09 09 09 09 09 7b |EN BEGIN|.......{|
|00002560| 20 49 66 20 74 68 69 73 | 20 69 73 6e 27 74 20 72 | If this| isn't r|
|00002570| 6f 6f 74 20 28 69 2e 65 | 2e 20 22 2f 22 29 2c 20 |oot (i.e|. "/"), |
|00002580| 61 70 70 65 6e 64 20 61 | 20 09 09 09 09 09 09 20 |append a| ...... |
|00002590| 20 73 6c 61 73 68 20 28 | 27 2f 27 29 20 7d 0d 09 | slash (|'/') }..|
|000025a0| 09 09 09 09 09 64 69 72 | 65 63 74 6f 72 79 4e 61 |.....dir|ectoryNa|
|000025b0| 6d 65 3a 3d 63 6f 6e 63 | 61 74 28 64 69 72 65 63 |me:=conc|at(direc|
|000025c0| 74 6f 72 79 4e 61 6d 65 | 2c 27 2f 27 29 3b 0d 09 |toryName|,'/');..|
|000025d0| 09 09 09 09 45 4e 44 3b | 0d 09 09 09 09 45 4e 44 |....END;|.....END|
|000025e0| 0d 09 09 09 09 45 4c 53 | 45 20 42 45 47 49 4e 0d |.....ELS|E BEGIN.|
|000025f0| 09 09 09 09 09 64 69 72 | 65 63 74 6f 72 79 4e 61 |.....dir|ectoryNa|
|00002600| 6d 65 3a 3d 63 6f 6e 63 | 61 74 28 64 69 72 65 63 |me:=conc|at(direc|
|00002610| 74 6f 72 79 4e 61 6d 65 | 2c 27 3a 27 29 3b 0d 09 |toryName|,':');..|
|00002620| 09 09 09 45 4e 44 3b 0d | 09 09 09 09 46 75 6c 6c |...END;.|....Full|
|00002630| 50 61 74 68 4e 61 6d 65 | 3a 3d 63 6f 6e 63 61 74 |PathName|:=concat|
|00002640| 28 64 69 72 65 63 74 6f | 72 79 4e 61 6d 65 2c 46 |(directo|ryName,F|
|00002650| 75 6c 6c 50 61 74 68 4e | 61 6d 65 29 3b 0d 09 09 |ullPathN|ame);...|
|00002660| 09 55 4e 54 49 4c 20 28 | 42 6c 6f 63 6b 2e 69 6f |.UNTIL (|Block.io|
|00002670| 44 72 44 69 72 49 44 3d | 66 73 52 74 44 69 72 49 |DrDirID=|fsRtDirI|
|00002680| 44 29 3b 0d 09 09 09 50 | 61 74 68 4e 61 6d 65 46 |D);....P|athNameF|
|00002690| 72 6f 6d 44 69 72 49 44 | 3a 3d 46 75 6c 6c 50 61 |romDirID|:=FullPa|
|000026a0| 74 68 4e 61 6d 65 3b 0d | 09 09 45 4e 44 3b 0d 28 |thName;.|..END;.(|
|000026b0| 2a 2a 20 50 61 74 68 4e | 61 6d 65 46 72 6f 6d 57 |** PathN|ameFromW|
|000026c0| 44 20 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |D ******|********|
|000026d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000026e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000026f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 29 0d |********|******).|
|00002700| 09 46 55 4e 43 54 49 4f | 4e 20 50 61 74 68 4e 61 |.FUNCTIO|N PathNa|
|00002710| 6d 65 46 72 6f 6d 57 44 | 28 76 52 65 66 6e 75 6d |meFromWD|(vRefnum|
|00002720| 3a 20 6c 6f 6e 67 69 6e | 74 29 3a 20 73 74 72 32 |: longin|t): str2|
|00002730| 35 35 3b 0d 09 09 56 41 | 52 0d 09 09 09 6d 79 42 |55;...VA|R....myB|
|00002740| 6c 6f 63 6b 3a 20 57 44 | 50 42 52 65 63 3b 0d 09 |lock: WD|PBRec;..|
|00002750| 09 42 45 47 49 4e 0d 09 | 09 09 7b 20 50 42 47 65 |.BEGIN..|..{ PBGe|
|00002760| 74 57 44 49 6e 66 6f 20 | 68 61 73 20 61 20 62 75 |tWDInfo |has a bu|
|00002770| 67 20 75 6e 64 65 72 20 | 41 2f 55 58 20 31 2e 31 |g under |A/UX 1.1|
|00002780| 2e 20 20 49 66 20 76 52 | 65 66 4e 75 6d 20 69 73 |. If vR|efNum is|
|00002790| 20 61 20 72 65 61 6c 20 | 09 09 09 28 20 20 76 52 | a real |...( vR|
|000027a0| 65 66 4e 75 6d 20 61 6e | 64 20 6e 6f 74 20 61 20 |efNum an|d not a |
|000027b0| 77 64 52 65 66 4e 75 6d | 2c 20 74 68 65 6e 20 69 |wdRefNum|, then i|
|000027c0| 74 20 72 65 74 75 72 6e | 73 20 67 61 72 62 61 67 |t return|s garbag|
|000027d0| 65 2e 09 53 69 6e 63 65 | 20 09 09 09 28 20 20 41 |e..Since| ...( A|
|000027e0| 2f 55 58 20 68 61 73 20 | 6f 6e 6c 79 20 31 0d 09 |/UX has |only 1..|
|000027f0| 09 09 7b 20 76 6f 6c 75 | 6d 65 20 28 69 6e 20 74 |..{ volu|me (in t|
|00002800| 68 65 20 4d 61 63 69 6e | 74 6f 73 68 20 73 65 6e |he Macin|tosh sen|
|00002810| 73 65 29 20 61 6e 64 20 | 6f 6e 6c 79 20 31 20 72 |se) and |only 1 r|
|00002820| 6f 6f 74 20 64 69 72 65 | 63 74 6f 72 79 2c 20 09 |oot dire|ctory, .|
|00002830| 09 09 28 20 20 74 68 69 | 73 20 63 61 6e 20 6f 63 |..( thi|s can oc|
|00002840| 63 75 72 20 6f 6e 6c 79 | 20 77 68 65 6e 20 61 20 |cur only| when a |
|00002850| 66 69 6c 65 20 68 61 73 | 20 62 65 65 6e 20 73 65 |file has| been se|
|00002860| 6c 65 63 74 65 64 20 69 | 6e 20 74 68 65 20 09 09 |lected i|n the ..|
|00002870| 09 28 20 20 72 6f 6f 74 | 20 64 69 72 65 63 74 6f |.( root| directo|
|00002880| 72 79 20 28 2f 29 2e 0d | 09 09 09 7b 20 53 6f 20 |ry (/)..|...{ So |
|00002890| 77 65 20 6c 6f 6f 6b 20 | 66 6f 72 20 74 68 69 73 |we look |for this|
|000028a0| 20 61 6e 64 20 68 61 72 | 64 20 63 6f 64 65 20 74 | and har|d code t|
|000028b0| 68 65 20 44 69 72 49 44 | 20 61 6e 64 20 76 52 65 |he DirID| and vRe|
|000028c0| 66 4e 75 6d 2e 20 7d 0d | 09 09 09 49 46 20 28 67 |fNum. }.|...IF (g|
|000028d0| 48 61 76 65 41 55 58 29 | 20 41 4e 44 20 28 76 52 |HaveAUX)| AND (vR|
|000028e0| 65 66 6e 75 6d 3d 2d 31 | 29 20 54 48 45 4e 20 42 |efnum=-1|) THEN B|
|000028f0| 45 47 49 4e 0d 09 09 09 | 09 50 61 74 68 4e 61 6d |EGIN....|.PathNam|
|00002900| 65 46 72 6f 6d 57 44 3a | 3d 50 61 74 68 4e 61 6d |eFromWD:|=PathNam|
|00002910| 65 46 72 6f 6d 44 69 72 | 49 44 28 32 2c 2d 31 29 |eFromDir|ID(2,-1)|
|00002920| 3b 0d 09 09 09 45 4e 44 | 0d 09 09 09 45 4c 53 45 |;....END|....ELSE|
|00002930| 20 42 45 47 49 4e 0d 09 | 09 09 09 57 49 54 48 20 | BEGIN..|...WITH |
|00002940| 6d 79 42 6c 6f 63 6b 20 | 44 4f 20 42 45 47 49 4e |myBlock |DO BEGIN|
|00002950| 0d 09 09 09 09 09 69 6f | 4e 61 6d 65 50 74 72 3a |......io|NamePtr:|
|00002960| 3d 4e 49 4c 3b 0d 09 09 | 09 09 09 69 6f 56 52 65 |=NIL;...|...ioVRe|
|00002970| 66 4e 75 6d 3a 3d 76 52 | 65 66 6e 75 6d 3b 0d 09 |fNum:=vR|efnum;..|
|00002980| 09 09 09 09 69 6f 57 44 | 49 6e 64 65 78 3a 3d 30 |....ioWD|Index:=0|
|00002990| 3b 0d 09 09 09 09 09 69 | 6f 57 44 50 72 6f 63 49 |;......i|oWDProcI|
|000029a0| 44 3a 3d 30 3b 0d 09 09 | 09 09 45 4e 44 3b 0d 09 |D:=0;...|..END;..|
|000029b0| 09 09 09 7b 20 43 68 61 | 6e 67 65 20 74 68 65 20 |...{ Cha|nge the |
|000029c0| 57 6f 72 6b 69 6e 67 20 | 44 69 72 65 63 74 6f 72 |Working |Director|
|000029d0| 79 20 6e 75 6d 62 65 72 | 20 69 6e 20 76 52 65 66 |y number| in vRef|
|000029e0| 6e 75 6d 20 69 6e 74 6f | 20 61 20 09 09 09 09 28 |num into| a ....(|
|000029f0| 20 72 65 61 6c 20 76 52 | 65 66 6e 75 6d 20 7d 0d | real vR|efnum }.|
|00002a00| 09 09 09 09 7b 20 61 6e | 64 20 44 69 72 49 44 2e |....{ an|d DirID.|
|00002a10| 20 54 68 65 20 72 65 61 | 6c 20 76 52 65 66 6e 75 | The rea|l vRefnu|
|00002a20| 6d 20 69 73 20 72 65 74 | 75 72 6e 65 64 20 69 6e |m is ret|urned in|
|00002a30| 20 69 6f 56 52 65 66 6e | 75 6d 2c 20 09 09 09 09 | ioVRefn|um, ....|
|00002a40| 28 20 61 6e 64 20 74 68 | 65 20 72 65 61 6c 20 7d |( and th|e real }|
|00002a50| 0d 09 09 09 09 7b 20 44 | 69 72 49 44 20 69 73 20 |.....{ D|irID is |
|00002a60| 72 65 74 75 72 6e 65 64 | 20 69 6e 20 69 6f 57 44 |returned| in ioWD|
|00002a70| 44 69 72 49 44 2e 20 7d | 0d 09 09 09 09 65 72 72 |DirID. }|.....err|
|00002a80| 3a 3d 50 42 47 65 74 57 | 44 49 6e 66 6f 28 40 6d |:=PBGetW|DInfo(@m|
|00002a90| 79 42 6c 6f 63 6b 2c 46 | 41 4c 53 45 29 3b 0d 09 |yBlock,F|ALSE);..|
|00002aa0| 09 09 09 57 49 54 48 20 | 6d 79 42 6c 6f 63 6b 20 |...WITH |myBlock |
|00002ab0| 44 4f 20 50 61 74 68 4e | 61 6d 65 46 72 6f 6d 57 |DO PathN|ameFromW|
|00002ac0| 44 3a 3d 50 61 74 68 4e | 61 6d 65 46 72 6f 6d 44 |D:=PathN|ameFromD|
|00002ad0| 69 72 49 44 28 69 6f 57 | 44 44 69 72 49 44 2c 69 |irID(ioW|DDirID,i|
|00002ae0| 6f 57 44 56 52 65 66 6e | 75 6d 29 0d 09 09 09 45 |oWDVRefn|um)....E|
|00002af0| 4e 44 3b 0d 09 09 45 4e | 44 3b 0d 4d 50 57 20 43 |ND;...EN|D;.MPW C|
|00002b00| 0d 2f 2a 2a 20 50 61 74 | 68 4e 61 6d 65 46 72 6f |./** Pat|hNameFro|
|00002b10| 6d 44 69 72 49 44 20 2a | 2a 2a 2a 2a 2a 2a 2a 2a |mDirID *|********|
|00002b20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002b50| 2f 0d 63 68 61 72 20 2a | 50 61 74 68 4e 61 6d 65 |/.char *|PathName|
|00002b60| 46 72 6f 6d 44 69 72 49 | 44 28 44 69 72 49 44 2c |FromDirI|D(DirID,|
|00002b70| 20 76 52 65 66 4e 75 6d | 2c 20 73 29 0d 09 6c 6f | vRefNum|, s)..lo|
|00002b80| 6e 67 09 09 44 69 72 49 | 44 3b 0d 09 73 68 6f 72 |ng..DirI|D;..shor|
|00002b90| 74 09 76 52 65 66 4e 75 | 6d 3b 0d 09 63 68 61 72 |t.vRefNu|m;..char|
|00002ba0| 09 09 2a 73 3b 0d 7b 0d | 09 43 49 6e 66 6f 50 42 |..*s;.{.|.CInfoPB|
|00002bb0| 52 65 63 09 62 6c 6f 63 | 6b 3b 0d 09 53 74 72 32 |Rec.bloc|k;..Str2|
|00002bc0| 35 35 09 09 64 69 72 65 | 63 74 6f 72 79 4e 61 6d |55..dire|ctoryNam|
|00002bd0| 65 3b 0d 09 2a 73 20 3d | 20 30 3b 0d 09 62 6c 6f |e;..*s =| 0;..blo|
|00002be0| 63 6b 2e 64 69 72 49 6e | 66 6f 2e 69 6f 4e 61 6d |ck.dirIn|fo.ioNam|
|00002bf0| 65 50 74 72 20 3d 20 64 | 69 72 65 63 74 6f 72 79 |ePtr = d|irectory|
|00002c00| 4e 61 6d 65 3b 0d 09 62 | 6c 6f 63 6b 2e 64 69 72 |Name;..b|lock.dir|
|00002c10| 49 6e 66 6f 2e 69 6f 44 | 72 50 61 72 49 44 20 3d |Info.ioD|rParID =|
|00002c20| 20 44 69 72 49 44 3b 0d | 09 64 6f 20 7b 0d 09 09 | DirID;.|.do {...|
|00002c30| 62 6c 6f 63 6b 2e 64 69 | 72 49 6e 66 6f 2e 69 6f |block.di|rInfo.io|
|00002c40| 56 52 65 66 4e 75 6d 20 | 3d 20 76 52 65 66 4e 75 |VRefNum |= vRefNu|
|00002c50| 6d 3b 0d 09 09 62 6c 6f | 63 6b 2e 64 69 72 49 6e |m;...blo|ck.dirIn|
|00002c60| 66 6f 2e 69 6f 46 44 69 | 72 49 6e 64 65 78 20 3d |fo.ioFDi|rIndex =|
|00002c70| 20 2d 31 3b 0d 09 09 62 | 6c 6f 63 6b 2e 64 69 72 | -1;...b|lock.dir|
|00002c80| 49 6e 66 6f 2e 69 6f 44 | 72 44 69 72 49 44 20 3d |Info.ioD|rDirID =|
|00002c90| 20 62 6c 6f 63 6b 2e 64 | 69 72 49 6e 66 6f 2e 69 | block.d|irInfo.i|
|00002ca0| 6f 44 72 50 61 72 49 44 | 3b 0d 09 09 65 72 72 20 |oDrParID|;...err |
|00002cb0| 3d 20 50 42 47 65 74 43 | 61 74 49 6e 66 6f 28 26 |= PBGetC|atInfo(&|
|00002cc0| 62 6c 6f 63 6b 2c 66 61 | 6c 73 65 29 3b 0d 09 09 |block,fa|lse);...|
|00002cd0| 69 66 20 28 67 48 61 76 | 65 41 55 58 29 20 7b 0d |if (gHav|eAUX) {.|
|00002ce0| 09 09 09 69 66 20 28 64 | 69 72 65 63 74 6f 72 79 |...if (d|irectory|
|00002cf0| 4e 61 6d 65 5b 31 5d 20 | 21 3d 20 27 2f 27 29 0d |Name[1] |!= '/').|
|00002d00| 09 09 09 09 2f 2a 20 49 | 66 20 74 68 69 73 20 69 |..../* I|f this i|
|00002d10| 73 6e 27 74 20 72 6f 6f | 74 20 28 69 2e 65 2e 20 |sn't roo|t (i.e. |
|00002d20| 27 2f 27 29 2c 20 61 70 | 70 65 6e 64 20 61 20 73 |'/'), ap|pend a s|
|00002d30| 6c 61 73 68 20 28 27 2f | 27 29 20 09 09 09 09 2a |lash ('/|') ....*|
|00002d40| 2f 0d 09 09 09 09 70 53 | 74 72 63 61 74 28 64 69 |/.....pS|trcat(di|
|00002d50| 72 65 63 74 6f 72 79 4e | 61 6d 65 2c 22 5c 70 2f |rectoryN|ame,"\p/|
|00002d60| 22 29 3b 0d 09 09 7d 20 | 65 6c 73 65 20 0d 09 09 |");...} |else ...|
|00002d70| 09 2f 2a 20 41 70 70 65 | 6e 64 20 61 20 4d 61 63 |./* Appe|nd a Mac|
|00002d80| 69 6e 74 6f 73 68 20 73 | 74 79 6c 65 20 63 6f 6c |intosh s|tyle col|
|00002d90| 6f 6e 20 28 27 3a 27 29 | 20 2a 2f 0d 09 09 09 70 |on (':')| */....p|
|00002da0| 53 74 72 63 61 74 28 64 | 69 72 65 63 74 6f 72 79 |Strcat(d|irectory|
|00002db0| 4e 61 6d 65 2c 22 5c 70 | 3a 22 29 3b 0d 09 09 70 |Name,"\p|:");...p|
|00002dc0| 53 74 72 63 61 74 28 64 | 69 72 65 63 74 6f 72 79 |Strcat(d|irectory|
|00002dd0| 4e 61 6d 65 2c 73 29 3b | 0d 09 09 70 53 74 72 63 |Name,s);|...pStrc|
|00002de0| 70 79 28 73 2c 64 69 72 | 65 63 74 6f 72 79 4e 61 |py(s,dir|ectoryNa|
|00002df0| 6d 65 29 3b 0d 09 7d 20 | 77 68 69 6c 65 20 28 62 |me);..} |while (b|
|00002e00| 6c 6f 63 6b 2e 64 69 72 | 49 6e 66 6f 2e 69 6f 44 |lock.dir|Info.ioD|
|00002e10| 72 44 69 72 49 44 20 21 | 3d 20 66 73 52 74 44 69 |rDirID !|= fsRtDi|
|00002e20| 72 49 44 29 3b 0d 09 72 | 65 74 75 72 6e 28 73 29 |rID);..r|eturn(s)|
|00002e30| 3b 0d 7d 0d 2f 2a 2a 20 | 50 61 74 68 4e 61 6d 65 |;.}./** |PathName|
|00002e40| 46 72 6f 6d 57 44 20 2a | 2a 2a 2a 2a 2a 2a 2a 2a |FromWD *|********|
|00002e50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002e60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002e70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002e80| 2a 2a 2a 2f 0d 63 68 61 | 72 20 2a 50 61 74 68 4e |***/.cha|r *PathN|
|00002e90| 61 6d 65 46 72 6f 6d 57 | 44 28 76 52 65 66 4e 75 |ameFromW|D(vRefNu|
|00002ea0| 6d 2c 73 29 0d 09 6c 6f | 6e 67 09 76 52 65 66 4e |m,s)..lo|ng.vRefN|
|00002eb0| 75 6d 3b 0d 09 63 68 61 | 72 09 2a 73 3b 0d 7b 0d |um;..cha|r.*s;.{.|
|00002ec0| 09 57 44 50 42 52 65 63 | 09 6d 79 42 6c 6f 63 6b |.WDPBRec|.myBlock|
|00002ed0| 3b 0d 09 2f 2a 0d 09 2f | 2a 20 50 42 47 65 74 57 |;../*../|* PBGetW|
|00002ee0| 44 49 6e 66 6f 20 68 61 | 73 20 61 20 62 75 67 20 |DInfo ha|s a bug |
|00002ef0| 75 6e 64 65 72 20 41 2f | 55 58 20 31 2e 31 2e 20 |under A/|UX 1.1. |
|00002f00| 20 49 66 20 76 52 65 66 | 4e 75 6d 20 69 73 20 61 | If vRef|Num is a|
|00002f10| 20 72 65 61 6c 20 76 52 | 65 66 4e 75 6d 0d 09 2f | real vR|efNum../|
|00002f20| 2a 20 61 6e 64 20 6e 6f | 74 20 61 20 77 64 52 65 |* and no|t a wdRe|
|00002f30| 66 4e 75 6d 2c 20 74 68 | 65 6e 20 69 74 20 72 65 |fNum, th|en it re|
|00002f40| 74 75 72 6e 73 20 67 61 | 72 62 61 67 65 2e 20 20 |turns ga|rbage. |
|00002f50| 53 69 6e 63 65 20 41 2f | 55 58 20 68 61 73 20 6f |Since A/|UX has o|
|00002f60| 6e 6c 79 20 31 0d 09 2f | 2a 20 76 6f 6c 75 6d 65 |nly 1../|* volume|
|00002f70| 20 28 69 6e 20 74 68 65 | 20 4d 61 63 69 6e 74 6f | (in the| Macinto|
|00002f80| 73 68 20 73 65 6e 73 65 | 29 20 61 6e 64 20 6f 6e |sh sense|) and on|
|00002f90| 6c 79 20 31 20 72 6f 6f | 74 20 64 69 72 65 63 74 |ly 1 roo|t direct|
|00002fa0| 6f 72 79 2c 20 74 68 69 | 73 20 63 61 6e 0d 09 2f |ory, thi|s can../|
|00002fb0| 2a 20 6f 63 63 75 72 20 | 6f 6e 6c 79 20 77 68 65 |* occur |only whe|
|00002fc0| 6e 20 61 20 66 69 6c 65 | 20 68 61 73 20 62 65 65 |n a file| has bee|
|00002fd0| 6e 20 73 65 6c 65 63 74 | 65 64 20 69 6e 20 74 68 |n select|ed in th|
|00002fe0| 65 20 72 6f 6f 74 20 64 | 69 72 65 63 74 6f 72 79 |e root d|irectory|
|00002ff0| 20 28 2f 29 2e 0d 09 2f | 2a 20 53 6f 20 77 65 20 | (/).../|* So we |
|00003000| 6c 6f 6f 6b 20 66 6f 72 | 20 74 68 69 73 20 61 6e |look for| this an|
|00003010| 64 20 68 61 72 64 20 63 | 6f 64 65 20 74 68 65 20 |d hard c|ode the |
|00003020| 44 69 72 49 44 20 61 6e | 64 20 76 52 65 66 4e 75 |DirID an|d vRefNu|
|00003030| 6d 2e 20 2a 2f 0d 09 69 | 66 20 28 67 48 61 76 65 |m. */..i|f (gHave|
|00003040| 41 55 58 20 26 26 20 28 | 76 52 65 66 4e 75 6d 20 |AUX && (|vRefNum |
|00003050| 3d 3d 20 2d 31 29 29 0d | 09 09 72 65 74 75 72 6e |== -1)).|..return|
|00003060| 28 50 61 74 68 4e 61 6d | 65 46 72 6f 6d 44 69 72 |(PathNam|eFromDir|
|00003070| 49 44 28 32 2c 2d 31 2c | 73 29 29 3b 0d 09 6d 79 |ID(2,-1,|s));..my|
|00003080| 42 6c 6f 63 6b 2e 69 6f | 4e 61 6d 65 50 74 72 20 |Block.io|NamePtr |
|00003090| 3d 20 6e 69 6c 3b 0d 09 | 6d 79 42 6c 6f 63 6b 2e |= nil;..|myBlock.|
|000030a0| 69 6f 56 52 65 66 4e 75 | 6d 20 3d 20 76 52 65 66 |ioVRefNu|m = vRef|
|000030b0| 4e 75 6d 3b 0d 09 6d 79 | 42 6c 6f 63 6b 2e 69 6f |Num;..my|Block.io|
|000030c0| 57 44 49 6e 64 65 78 20 | 3d 20 30 3b 0d 09 6d 79 |WDIndex |= 0;..my|
|000030d0| 42 6c 6f 63 6b 2e 69 6f | 57 44 50 72 6f 63 49 44 |Block.io|WDProcID|
|000030e0| 20 3d 20 30 3b 0d 09 2f | 2a 20 43 68 61 6e 67 65 | = 0;../|* Change|
|000030f0| 20 74 68 65 20 57 6f 72 | 6b 69 6e 67 20 44 69 72 | the Wor|king Dir|
|00003100| 65 63 74 6f 72 79 20 6e | 75 6d 62 65 72 20 69 6e |ectory n|umber in|
|00003110| 20 76 52 65 66 6e 75 6d | 20 69 6e 74 6f 20 61 20 | vRefnum| into a |
|00003120| 72 65 61 6c 20 76 52 65 | 66 6e 75 6d 20 2a 2f 0d |real vRe|fnum */.|
|00003130| 09 2f 2a 20 61 6e 64 20 | 44 69 72 49 44 2e 20 54 |./* and |DirID. T|
|00003140| 68 65 20 72 65 61 6c 20 | 76 52 65 66 6e 75 6d 20 |he real |vRefnum |
|00003150| 69 73 20 72 65 74 75 72 | 6e 65 64 20 69 6e 20 69 |is retur|ned in i|
|00003160| 6f 56 52 65 66 6e 75 6d | 2c 20 61 6e 64 20 74 68 |oVRefnum|, and th|
|00003170| 65 20 72 65 61 6c 20 2a | 2f 0d 09 2f 2a 20 44 69 |e real *|/../* Di|
|00003180| 72 49 44 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |rID is r|eturned |
|00003190| 69 6e 20 69 6f 57 44 44 | 69 72 49 44 2e 20 2a 2f |in ioWDD|irID. */|
|000031a0| 0d 09 50 42 47 65 74 57 | 44 49 6e 66 6f 28 26 6d |..PBGetW|DInfo(&m|
|000031b0| 79 42 6c 6f 63 6b 2c 66 | 61 6c 73 65 29 3b 0d 09 |yBlock,f|alse);..|
|000031c0| 72 65 74 75 72 6e 28 50 | 61 74 68 4e 61 6d 65 46 |return(P|athNameF|
|000031d0| 72 6f 6d 44 69 72 49 44 | 28 6d 79 42 6c 6f 63 6b |romDirID|(myBlock|
|000031e0| 2e 69 6f 57 44 44 69 72 | 49 44 2c 6d 79 42 6c 6f |.ioWDDir|ID,myBlo|
|000031f0| 63 6b 2e 69 6f 57 44 56 | 52 65 66 4e 75 6d 2c 73 |ck.ioWDV|RefNum,s|
|00003200| 29 29 3b 0d 7d 3b 0d 2f | 2a 2a 20 70 53 74 72 63 |));.};./|** pStrc|
|00003210| 61 74 20 2f 20 70 53 74 | 72 43 70 79 20 2a 2a 2a |at / pSt|rCpy ***|
|00003220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003250| 2a 2a 2a 2a 2a 2a 2f 0d | 2f 2a 0d 2f 2a 09 41 20 |******/.|/*./*.A |
|00003260| 63 6f 75 70 6c 65 20 6f | 66 20 75 74 69 6c 69 74 |couple o|f utilit|
|00003270| 79 20 72 6f 75 74 69 6e | 65 73 2e 20 43 20 69 73 |y routin|es. C is|
|00003280| 20 74 68 6f 75 67 68 74 | 6c 65 73 73 20 65 6e 6f | thought|less eno|
|00003290| 75 67 68 20 74 6f 20 6e | 6f 74 20 72 65 61 6c 6c |ugh to n|ot reall|
|000032a0| 79 20 0d 2f 2a 09 73 75 | 70 70 6f 72 74 20 50 2d |y ./*.su|pport P-|
|000032b0| 73 74 72 69 6e 67 73 2e | 20 49 6e 20 6f 72 64 65 |strings.| In orde|
|000032c0| 72 20 74 6f 20 70 65 72 | 66 6f 72 6d 20 73 74 72 |r to per|form str|
|000032d0| 69 6e 67 20 63 6f 70 69 | 65 73 20 61 6e 64 20 63 |ing copi|es and c|
|000032e0| 6f 6e 63 61 74 65 6e 61 | 74 69 6f 6e 73 2c 0d 2f |oncatena|tions,./|
|000032f0| 2a 09 74 68 65 73 65 20 | 72 6f 75 74 69 6e 65 73 |*.these |routines|
|00003300| 20 61 72 65 20 70 72 6f | 76 69 64 65 64 2e 0d 2f | are pro|vided../|
|00003310| 2a 0d 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |*./*****|********|
|00003320| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003330| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003340| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003350| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003360| 2a 2f 0d 23 64 65 66 69 | 6e 65 20 4d 49 4e 28 61 |*/.#defi|ne MIN(a|
|00003370| 2c 62 29 20 28 28 28 61 | 29 3c 28 62 29 29 3f 28 |,b) (((a|)<(b))?(|
|00003380| 61 29 3a 28 62 29 29 0d | 63 68 61 72 20 2a 70 53 |a):(b)).|char *pS|
|00003390| 74 72 63 61 74 28 64 65 | 73 74 2c 20 73 72 63 29 |trcat(de|st, src)|
|000033a0| 0d 75 6e 73 69 67 6e 65 | 64 20 63 68 61 72 20 2a |.unsigne|d char *|
|000033b0| 64 65 73 74 2c 20 2a 73 | 72 63 3b 0d 7b 0d 09 6c |dest, *s|rc;.{..l|
|000033c0| 6f 6e 67 20 73 4c 65 6e | 20 3d 20 4d 49 4e 28 2a |ong sLen| = MIN(*|
|000033d0| 73 72 63 2c 20 32 35 35 | 20 2d 20 2a 64 65 73 74 |src, 255| - *dest|
|000033e0| 29 3b 0d 09 42 6c 6f 63 | 6b 4d 6f 76 65 28 73 72 |);..Bloc|kMove(sr|
|000033f0| 63 20 2b 20 31 2c 20 64 | 65 73 74 20 2b 20 2a 64 |c + 1, d|est + *d|
|00003400| 65 73 74 20 2b 20 31 2c | 20 73 4c 65 6e 29 3b 0d |est + 1,| sLen);.|
|00003410| 09 2a 64 65 73 74 20 2b | 3d 20 73 4c 65 6e 3b 0d |.*dest +|= sLen;.|
|00003420| 09 72 65 74 75 72 6e 20 | 28 64 65 73 74 29 3b 0d |.return |(dest);.|
|00003430| 7d 0d 63 68 61 72 20 2a | 70 53 74 72 63 70 79 28 |}.char *|pStrcpy(|
|00003440| 64 65 73 74 2c 20 73 72 | 63 29 0d 75 6e 73 69 67 |dest, sr|c).unsig|
|00003450| 6e 65 64 20 63 68 61 72 | 20 2a 64 65 73 74 2c 20 |ned char| *dest, |
|00003460| 2a 73 72 63 3b 0d 7b 0d | 09 42 6c 6f 63 6b 4d 6f |*src;.{.|.BlockMo|
|00003470| 76 65 28 73 72 63 2c 20 | 64 65 73 74 2c 20 28 6c |ve(src, |dest, (l|
|00003480| 6f 6e 67 29 20 2a 73 72 | 63 20 2b 20 31 29 3b 20 |ong) *sr|c + 1); |
|00003490| 0d 09 72 65 74 75 72 6e | 20 28 64 65 73 74 29 3b |..return| (dest);|
|000034a0| 0d 7d 0d 46 75 72 74 68 | 65 72 20 52 65 66 65 72 |.}.Furth|er Refer|
|000034b0| 65 6e 63 65 3a 0d a5 09 | 49 6e 73 69 64 65 20 4d |ence:...|Inside M|
|000034c0| 61 63 69 6e 74 6f 73 68 | 2c 20 56 6f 6c 75 6d 65 |acintosh|, Volume|
|000034d0| 20 49 56 2d 38 39 2c 20 | 46 69 6c 65 20 4d 61 6e | IV-89, |File Man|
|000034e0| 61 67 65 72 0d 4e 6f 74 | 69 63 65 3a 20 54 68 65 |ager.Not|ice: The|
|000034f0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 69 6e 20 | informa|tion in |
|00003500| 74 68 69 73 20 54 65 63 | 68 6e 69 63 61 6c 20 4e |this Tec|hnical N|
|00003510| 6f 74 65 20 63 61 6e 20 | 6e 6f 77 20 62 65 20 66 |ote can |now be f|
|00003520| 6f 75 6e 64 20 69 6e 20 | 49 6e 73 69 64 65 20 4d |ound in |Inside M|
|00003530| 61 63 69 6e 74 6f 73 68 | 3a 46 69 6c 65 73 20 43 |acintosh|:Files C|
|00003540| 68 61 70 74 65 72 20 31 | 2e 20 20 54 68 69 73 20 |hapter 1|. This |
|00003550| 6e 6f 74 65 20 77 69 6c | 6c 20 62 65 20 72 65 6d |note wil|l be rem|
|00003560| 6f 76 65 64 20 66 72 6f | 6d 20 74 68 65 20 54 65 |oved fro|m the Te|
|00003570| 63 68 6e 69 63 61 6c 20 | 4e 6f 74 65 20 6c 69 62 |chnical |Note lib|
|00003580| 72 61 72 79 20 69 6e 20 | 74 68 65 20 6e 65 61 72 |rary in |the near|
|00003590| 20 66 75 74 75 72 65 2e | 0d 46 4c 20 35 20 2d 20 | future.|.FL 5 - |
|000035a0| 48 46 53 20 43 6f 6d 70 | 61 74 69 62 69 6c 69 74 |HFS Comp|atibilit|
|000035b0| 79 20 47 75 69 64 65 6c | 69 6e 65 73 0d 46 69 6c |y Guidel|ines.Fil|
|000035c0| 65 73 09 09 0d 52 65 76 | 69 73 65 64 20 62 79 3a |es...Rev|ised by:|
|000035d0| 09 53 63 6f 74 74 20 4b | 6e 61 73 74 65 72 09 4d |.Scott K|naster.M|
|000035e0| 61 72 63 68 20 31 39 38 | 38 0d 09 09 4a 69 6d 20 |arch 198|8...Jim |
|000035f0| 46 72 69 65 64 6c 61 6e | 64 65 72 09 0d 57 72 69 |Friedlan|der..Wri|
|00003600| 74 74 65 6e 20 62 79 3a | 09 4a 69 6d 20 46 72 69 |tten by:|.Jim Fri|
|00003610| 65 64 6c 61 6e 64 65 72 | 09 4f 63 74 6f 62 65 72 |edlander|.October|
|00003620| 20 31 39 38 35 0d 54 68 | 69 73 20 74 65 63 68 6e | 1985.Th|is techn|
|00003630| 69 63 61 6c 20 6e 6f 74 | 65 20 74 65 6c 6c 73 20 |ical not|e tells |
|00003640| 79 6f 75 20 68 6f 77 20 | 74 6f 20 6d 61 6b 65 20 |you how |to make |
|00003650| 73 75 72 65 20 74 68 61 | 74 20 79 6f 75 72 20 61 |sure tha|t your a|
|00003660| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 72 75 6e 20 |pplicati|ons run |
|00003670| 75 6e 64 65 72 20 74 68 | 65 20 48 69 65 72 61 72 |under th|e Hierar|
|00003680| 63 68 69 63 61 6c 20 46 | 69 6c 65 20 53 79 73 74 |chical F|ile Syst|
|00003690| 65 6d 20 28 48 46 53 29 | 2e 0d 54 68 65 20 48 69 |em (HFS)|..The Hi|
|000036a0| 65 72 61 72 63 68 69 63 | 61 6c 20 46 69 6c 65 20 |erarchic|al File |
|000036b0| 53 79 73 74 65 6d 20 28 | 48 46 53 29 20 70 72 6f |System (|HFS) pro|
|000036c0| 76 69 64 65 73 20 66 61 | 73 74 2c 20 65 66 66 69 |vides fa|st, effi|
|000036d0| 63 69 65 6e 74 20 6d 61 | 6e 61 67 65 6d 65 6e 74 |cient ma|nagement|
|000036e0| 20 6f 66 20 6c 61 72 67 | 65 72 20 76 6f 6c 75 6d | of larg|er volum|
|000036f0| 65 73 20 74 68 61 6e 20 | 74 68 65 20 6f 72 69 67 |es than |the orig|
|00003700| 69 6e 61 6c 20 4d 61 63 | 69 6e 74 6f 73 68 20 46 |inal Mac|intosh F|
|00003710| 69 6c 65 20 53 79 73 74 | 65 6d 20 28 4d 46 53 29 |ile Syst|em (MFS)|
|00003720| 2e 20 53 69 6e 63 65 20 | 48 46 53 20 69 73 20 68 |. Since |HFS is h|
|00003730| 69 65 72 61 72 63 68 69 | 63 61 6c 2c 20 48 46 53 |ierarchi|cal, HFS|
|00003740| 20 66 6f 6c 64 65 72 73 | 20 68 61 76 65 20 61 20 | folders| have a |
|00003750| 6d 65 61 6e 69 6e 67 20 | 64 69 66 66 65 72 65 6e |meaning |differen|
|00003760| 74 20 66 72 6f 6d 20 4d | 46 53 20 66 6f 6c 64 65 |t from M|FS folde|
|00003770| 72 73 2e 20 49 6e 20 4d | 46 53 2c 20 61 20 66 6f |rs. In M|FS, a fo|
|00003780| 6c 64 65 72 20 68 61 73 | 20 6f 6e 6c 79 20 67 72 |lder has| only gr|
|00003790| 61 70 68 69 63 61 6c 20 | 73 69 67 6e 69 66 69 63 |aphical |signific|
|000037a0| 61 6e 63 65 d1 69 74 20 | 69 73 20 6f 6e 6c 79 20 |ance.it |is only |
|000037b0| 75 73 65 64 20 62 79 20 | 74 68 65 20 46 69 6e 64 |used by |the Find|
|000037c0| 65 72 20 61 73 20 61 20 | 6d 65 61 6e 73 20 6f 66 |er as a |means of|
|000037d0| 20 76 69 73 75 61 6c 6c | 79 20 67 72 6f 75 70 69 | visuall|y groupi|
|000037e0| 6e 67 20 66 69 6c 65 73 | 2e 20 54 68 65 20 4d 46 |ng files|. The MF|
|000037f0| 53 20 64 69 72 65 63 74 | 6f 72 79 20 73 74 72 75 |S direct|ory stru|
|00003800| 63 74 75 72 65 20 69 73 | 20 61 63 74 75 61 6c 6c |cture is| actuall|
|00003810| 79 20 66 6c 61 74 20 28 | 61 6c 6c 20 66 69 6c 65 |y flat (|all file|
|00003820| 73 20 61 72 65 20 61 74 | 20 74 68 65 20 d4 72 6f |s are at| the .ro|
|00003830| 6f 74 d5 20 6c 65 76 65 | 6c 29 2e 20 55 6e 64 65 |ot. leve|l). Unde|
|00003840| 72 20 48 46 53 2c 20 61 | 20 66 6f 6c 64 65 72 20 |r HFS, a| folder |
|00003850| 69 73 20 61 20 64 69 72 | 65 63 74 6f 72 79 20 74 |is a dir|ectory t|
|00003860| 68 61 74 20 63 61 6e 20 | 63 6f 6e 74 61 69 6e 20 |hat can |contain |
|00003870| 66 69 6c 65 73 20 61 6e | 64 20 6f 74 68 65 72 20 |files an|d other |
|00003880| 64 69 72 65 63 74 6f 72 | 69 65 73 2e 0d 41 20 66 |director|ies..A f|
|00003890| 6f 6c 64 65 72 20 69 73 | 20 61 63 63 65 73 73 65 |older is| accesse|
|000038a0| 64 20 62 79 20 75 73 65 | 20 6f 66 20 61 20 57 44 |d by use| of a WD|
|000038b0| 52 65 66 4e 75 6d 20 28 | 57 6f 72 6b 69 6e 67 20 |RefNum (|Working |
|000038c0| 44 69 72 65 63 74 6f 72 | 79 20 72 65 66 65 72 65 |Director|y refere|
|000038d0| 6e 63 65 20 6e 75 6d 62 | 65 72 29 2e 20 43 61 6c |nce numb|er). Cal|
|000038e0| 6c 73 20 74 68 61 74 20 | 72 65 74 75 72 6e 20 61 |ls that |return a|
|000038f0| 20 76 52 65 66 4e 75 6d | 20 77 68 65 6e 20 72 75 | vRefNum| when ru|
|00003900| 6e 6e 69 6e 67 20 75 6e | 64 65 72 20 4d 46 53 20 |nning un|der MFS |
|00003910| 6d 61 79 20 72 65 74 75 | 72 6e 20 61 20 57 44 52 |may retu|rn a WDR|
|00003920| 65 66 4e 75 6d 20 77 68 | 65 6e 20 72 75 6e 6e 69 |efNum wh|en runni|
|00003930| 6e 67 20 75 6e 64 65 72 | 20 48 46 53 2e 20 59 6f |ng under| HFS. Yo|
|00003940| 75 20 6d 61 79 20 75 73 | 65 20 61 20 57 44 52 65 |u may us|e a WDRe|
|00003950| 66 4e 75 6d 20 77 68 65 | 72 65 76 65 72 20 61 20 |fNum whe|rever a |
|00003960| 76 52 65 66 4e 75 6d 20 | 6d 61 79 20 62 65 20 75 |vRefNum |may be u|
|00003970| 73 65 64 2e 20 0d 49 6e | 20 6f 72 64 65 72 20 74 |sed. .In| order t|
|00003980| 6f 20 70 72 6f 76 69 64 | 65 20 66 6f 72 20 63 6f |o provid|e for co|
|00003990| 6d 70 61 74 69 62 69 6c | 69 74 79 20 77 69 74 68 |mpatibil|ity with|
|000039a0| 20 73 6f 66 74 77 61 72 | 65 20 77 72 69 74 74 65 | softwar|e writte|
|000039b0| 6e 20 66 6f 72 20 4d 46 | 53 2c 20 74 68 65 20 48 |n for MF|S, the H|
|000039c0| 46 53 20 63 61 6c 6c 73 | 20 74 68 61 74 20 6f 70 |FS calls| that op|
|000039d0| 65 6e 20 66 69 6c 65 73 | 20 73 65 61 72 63 68 20 |en files| search |
|000039e0| 62 6f 74 68 20 74 68 65 | 20 64 65 66 61 75 6c 74 |both the| default|
|000039f0| 20 64 69 72 65 63 74 6f | 72 79 20 61 6e 64 20 74 | directo|ry and t|
|00003a00| 68 65 20 64 69 72 65 63 | 74 6f 72 79 20 74 68 61 |he direc|tory tha|
|00003a10| 74 20 63 6f 6e 74 61 69 | 6e 73 20 74 68 65 20 53 |t contai|ns the S|
|00003a20| 79 73 74 65 6d 20 61 6e | 64 20 74 68 65 20 46 69 |ystem an|d the Fi|
|00003a30| 6e 64 65 72 20 28 48 46 | 53 20 6d 61 72 6b 73 20 |nder (HF|S marks |
|00003a40| 74 68 69 73 20 6c 61 73 | 74 20 64 69 72 65 63 74 |this las|t direct|
|00003a50| 6f 72 79 20 73 6f 20 69 | 74 20 61 6c 77 61 79 73 |ory so i|t always|
|00003a60| 20 6b 6e 6f 77 73 20 77 | 68 65 72 65 20 74 6f 20 | knows w|here to |
|00003a70| 6c 6f 6f 6b 20 66 6f 72 | 20 74 68 65 20 53 79 73 |look for| the Sys|
|00003a80| 74 65 6d 20 61 6e 64 20 | 74 68 65 20 46 69 6e 64 |tem and |the Find|
|00003a90| 65 72 29 2e 0d 59 6f 75 | 72 20 67 6f 61 6c 20 73 |er)..You|r goal s|
|00003aa0| 68 6f 75 6c 64 20 62 65 | 20 74 6f 20 77 72 69 74 |hould be| to writ|
|00003ab0| 65 20 70 72 6f 67 72 61 | 6d 73 20 74 68 61 74 20 |e progra|ms that |
|00003ac0| 61 72 65 20 66 69 6c 65 | 20 73 79 73 74 65 6d 20 |are file| system |
|00003ad0| 69 6e 64 65 70 65 6e 64 | 65 6e 74 2e 20 59 6f 75 |independ|ent. You|
|00003ae0| 72 20 70 72 6f 67 72 61 | 6d 73 20 73 68 6f 75 6c |r progra|ms shoul|
|00003af0| 64 20 6e 6f 74 20 6f 6e | 6c 79 20 62 65 20 61 62 |d not on|ly be ab|
|00003b00| 6c 65 20 74 6f 20 61 63 | 63 65 73 73 20 66 69 6c |le to ac|cess fil|
|00003b10| 65 73 20 6f 6e 20 6f 74 | 68 65 72 20 76 6f 6c 75 |es on ot|her volu|
|00003b20| 6d 65 73 2c 20 62 75 74 | 20 61 6c 73 6f 20 66 69 |mes, but| also fi|
|00003b30| 6c 65 73 20 74 68 61 74 | 20 61 72 65 20 69 6e 20 |les that| are in |
|00003b40| 6f 74 68 65 72 20 64 69 | 72 65 63 74 6f 72 69 65 |other di|rectorie|
|00003b50| 73 2e 20 41 63 63 6f 6d | 70 6c 69 73 68 69 6e 67 |s. Accom|plishing|
|00003b60| 20 74 68 69 73 20 69 73 | 20 6e 6f 74 20 64 69 66 | this is| not dif|
|00003b70| 66 69 63 75 6c 74 d1 6d | 6f 73 74 20 61 70 70 6c |ficult.m|ost appl|
|00003b80| 69 63 61 74 69 6f 6e 73 | 20 74 68 61 74 20 77 65 |ications| that we|
|00003b90| 72 65 20 77 72 69 74 74 | 65 6e 20 66 6f 72 20 4d |re writt|en for M|
|00003ba0| 46 53 20 77 6f 72 6b 20 | 63 6f 72 72 65 63 74 6c |FS work |correctl|
|00003bb0| 79 20 75 6e 64 65 72 20 | 48 46 53 2e 20 49 66 20 |y under |HFS. If |
|00003bc0| 79 6f 75 20 66 69 6e 64 | 20 74 68 61 74 20 79 6f |you find| that yo|
|00003bd0| 75 72 20 63 75 72 72 65 | 6e 74 20 61 70 70 6c 69 |ur curre|nt appli|
|00003be0| 63 61 74 69 6f 6e 73 20 | 64 6f 20 6e 6f 74 20 72 |cations |do not r|
|00003bf0| 75 6e 20 63 6f 72 72 65 | 63 74 6c 79 20 75 6e 64 |un corre|ctly und|
|00003c00| 65 72 20 48 46 53 2c 20 | 79 6f 75 20 73 68 6f 75 |er HFS, |you shou|
|00003c10| 6c 64 20 63 68 65 63 6b | 20 74 6f 20 73 65 65 20 |ld check| to see |
|00003c20| 69 66 20 79 6f 75 20 61 | 72 65 20 64 6f 69 6e 67 |if you a|re doing|
|00003c30| 20 61 6e 79 20 6f 66 20 | 74 68 65 20 66 6f 6c 6c | any of |the foll|
|00003c40| 6f 77 69 6e 67 20 66 69 | 76 65 20 74 68 69 6e 67 |owing fi|ve thing|
|00003c50| 73 3a 20 0d 41 72 65 20 | 79 6f 75 20 75 73 69 6e |s: .Are |you usin|
|00003c60| 67 20 53 74 61 6e 64 61 | 72 64 20 46 69 6c 65 3f |g Standa|rd File?|
|00003c70| 0d 54 68 69 73 20 69 73 | 20 76 65 72 79 20 69 6d |.This is| very im|
|00003c80| 70 6f 72 74 61 6e 74 20 | 74 6f 20 65 6e 73 75 72 |portant |to ensur|
|00003c90| 65 20 74 68 61 74 20 79 | 6f 75 72 20 61 70 70 6c |e that y|our appl|
|00003ca0| 69 63 61 74 69 6f 6e 20 | 77 69 6c 6c 20 72 75 6e |ication |will run|
|00003cb0| 20 63 6f 72 72 65 63 74 | 6c 79 20 75 6e 64 65 72 | correct|ly under|
|00003cc0| 20 48 46 53 2e 20 48 46 | 53 20 75 73 65 73 20 61 | HFS. HF|S uses a|
|00003cd0| 6e 20 65 78 74 65 6e 64 | 65 64 20 53 74 61 6e 64 |n extend|ed Stand|
|00003ce0| 61 72 64 20 46 69 6c 65 | 2c 20 77 68 69 63 68 20 |ard File|, which |
|00003cf0| 61 6c 6c 6f 77 73 20 74 | 68 65 20 75 73 65 72 20 |allows t|he user |
|00003d00| 74 6f 20 73 65 6c 65 63 | 74 20 66 72 6f 6d 20 66 |to selec|t from f|
|00003d10| 69 6c 65 73 20 69 6e 20 | 64 69 66 66 65 72 65 6e |iles in |differen|
|00003d20| 74 20 64 69 72 65 63 74 | 6f 72 69 65 73 2e 20 54 |t direct|ories. T|
|00003d30| 68 69 73 20 69 6e 63 72 | 65 61 73 65 64 20 66 75 |his incr|eased fu|
|00003d40| 6e 63 74 69 6f 6e 61 6c | 69 74 79 20 77 61 73 20 |nctional|ity was |
|00003d50| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 77 69 74 68 |implemen|ted with|
|00003d60| 6f 75 74 20 63 68 61 6e | 67 69 6e 67 20 53 74 61 |out chan|ging Sta|
|00003d70| 6e 64 61 72 64 20 46 69 | 6c 65 d5 73 20 65 78 74 |ndard Fi|le.s ext|
|00003d80| 65 72 6e 61 6c 20 73 70 | 65 63 69 66 69 63 61 74 |ernal sp|ecificat|
|00003d90| 69 6f 6e d1 74 68 65 20 | 6f 6e 6c 79 20 64 69 66 |ion.the |only dif|
|00003da0| 66 65 72 65 6e 63 65 20 | 69 73 20 74 68 61 74 20 |ference |is that |
|00003db0| 53 46 52 65 70 6c 79 2e | 76 52 65 66 4e 75 6d 20 |SFReply.|vRefNum |
|00003dc0| 63 61 6e 20 6e 6f 77 20 | 62 65 20 61 20 57 44 52 |can now |be a WDR|
|00003dd0| 65 66 4e 75 6d 2e 20 50 | 6c 65 61 73 65 20 6e 6f |efNum. P|lease no|
|00003de0| 74 65 20 74 68 61 74 20 | 75 73 69 6e 67 20 53 74 |te that |using St|
|00003df0| 61 6e 64 61 72 64 20 46 | 69 6c 65 d5 73 20 64 69 |andard F|ile.s di|
|00003e00| 61 6c 6f 67 20 68 6f 6f | 6b 20 61 6e 64 20 66 69 |alog hoo|k and fi|
|00003e10| 6c 74 65 72 20 70 72 6f | 63 73 20 6f 72 20 61 64 |lter pro|cs or ad|
|00003e20| 64 69 6e 67 20 63 6f 6e | 74 72 6f 6c 73 20 6f 66 |ding con|trols of|
|00003e30| 20 79 6f 75 72 20 6f 77 | 6e 20 77 69 6c 6c 20 6e | your ow|n will n|
|00003e40| 6f 74 20 63 61 75 73 65 | 20 63 6f 6d 70 61 74 69 |ot cause| compati|
|00003e50| 62 69 6c 69 74 79 20 70 | 72 6f 62 6c 65 6d 73 20 |bility p|roblems |
|00003e60| 77 69 74 68 20 48 46 53 | 2e 0d 45 78 69 73 74 69 |with HFS|..Existi|
|00003e70| 6e 67 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 73 20 |ng appli|cations |
|00003e80| 74 68 61 74 20 75 73 65 | 20 53 74 61 6e 64 61 72 |that use| Standar|
|00003e90| 64 20 46 69 6c 65 20 70 | 72 6f 70 65 72 6c 79 20 |d File p|roperly |
|00003ea0| 72 75 6e 20 77 69 74 68 | 6f 75 74 20 6d 6f 64 69 |run with|out modi|
|00003eb0| 66 69 63 61 74 69 6f 6e | 20 75 6e 64 65 72 20 48 |fication| under H|
|00003ec0| 46 53 2e 20 41 70 70 6c | 69 63 61 74 69 6f 6e 73 |FS. Appl|ications|
|00003ed0| 20 74 68 61 74 20 74 61 | 6b 65 20 74 68 65 20 53 | that ta|ke the S|
|00003ee0| 46 52 65 70 6c 79 2e 76 | 52 65 66 4e 75 6d 20 61 |FReply.v|RefNum a|
|00003ef0| 6e 64 20 63 6f 6e 76 65 | 72 74 20 74 68 61 74 20 |nd conve|rt that |
|00003f00| 74 6f 20 61 20 76 6f 6c | 75 6d 65 20 6e 61 6d 65 |to a vol|ume name|
|00003f10| 2c 20 74 68 65 6e 20 61 | 70 70 65 6e 64 20 69 74 |, then a|ppend it|
|00003f20| 20 74 6f 20 53 46 52 65 | 70 6c 79 2e 66 4e 61 6d | to SFRe|ply.fNam|
|00003f30| 65 20 28 61 73 20 69 6e | 20 23 32 20 62 65 6c 6f |e (as in| #2 belo|
|00003f40| 77 29 20 64 6f 20 6e 6f | 74 20 66 75 6e 63 74 69 |w) do no|t functi|
|00003f50| 6f 6e 20 63 6f 72 72 65 | 63 74 6c 79 20 75 6e 64 |on corre|ctly und|
|00003f60| 65 72 20 48 46 53 d1 74 | 68 65 20 75 73 65 72 20 |er HFS.t|he user |
|00003f70| 63 61 6e 20 6f 6e 6c 79 | 20 6f 70 65 6e 20 66 69 |can only| open fi|
|00003f80| 6c 65 73 20 69 6e 20 74 | 68 65 20 72 6f 6f 74 20 |les in t|he root |
|00003f90| 64 69 72 65 63 74 6f 72 | 79 2e 20 49 66 20 79 6f |director|y. If yo|
|00003fa0| 75 20 63 61 6c 6c 20 4f | 70 65 6e 20 77 69 74 68 |u call O|pen with|
|00003fb0| 20 53 46 52 65 70 6c 79 | 2e 76 52 65 66 4e 75 6d | SFReply|.vRefNum|
|00003fc0| 20 61 6e 64 20 53 46 52 | 65 70 6c 79 2e 66 4e 61 | and SFR|eply.fNa|
|00003fd0| 6d 65 2c 20 65 76 65 72 | 79 74 68 69 6e 67 20 77 |me, ever|ything w|
|00003fe0| 69 6c 6c 20 77 6f 72 6b | 20 63 6f 72 72 65 63 74 |ill work| correct|
|00003ff0| 6c 79 2e 20 52 65 6d 65 | 6d 62 65 72 2c 20 53 46 |ly. Reme|mber, SF|
|00004000| 52 65 70 6c 79 2e 76 52 | 65 66 4e 75 6d 20 6d 61 |Reply.vR|efNum ma|
|00004010| 79 20 62 65 20 61 20 57 | 44 52 65 66 4e 75 6d 20 |y be a W|DRefNum |
|00004020| 2e 20 55 73 69 6e 67 20 | 53 74 61 6e 64 61 72 64 |. Using |Standard|
|00004030| 20 46 69 6c 65 20 77 69 | 6c 6c 20 76 69 72 74 75 | File wi|ll virtu|
|00004040| 61 6c 6c 79 20 67 75 61 | 72 61 6e 74 65 65 20 74 |ally gua|rantee t|
|00004050| 68 61 74 20 79 6f 75 72 | 20 61 70 70 6c 69 63 61 |hat your| applica|
|00004060| 74 69 6f 6e 20 77 69 6c | 6c 20 62 65 20 63 6f 6d |tion wil|l be com|
|00004070| 70 61 74 69 62 6c 65 20 | 77 69 74 68 20 4d 46 53 |patible |with MFS|
|00004080| 2c 20 48 46 53 2c 20 61 | 6e 64 20 66 75 74 75 72 |, HFS, a|nd futur|
|00004090| 65 20 66 69 6c 65 20 73 | 79 73 74 65 6d 73 2e 0d |e file s|ystems..|
|000040a0| 41 72 65 20 79 6f 75 20 | 63 6f 6e 63 61 74 65 6e |Are you |concaten|
|000040b0| 61 74 69 6e 67 20 76 6f | 6c 75 6d 65 20 6e 61 6d |ating vo|lume nam|
|000040c0| 65 73 20 74 6f 20 66 69 | 6c 65 20 6e 61 6d 65 73 |es to fi|le names|
|000040d0| 2c 20 69 2e 65 2e 20 75 | 73 69 6e 67 20 66 69 6c |, i.e. u|sing fil|
|000040e0| 65 20 6e 61 6d 65 73 20 | 6f 66 20 74 68 65 20 66 |e names |of the f|
|000040f0| 6f 72 6d 20 56 4f 4c 55 | 4d 45 3a 66 69 6c 65 4e |orm VOLU|ME:fileN|
|00004100| 61 6d 65 3f 0d 41 70 70 | 6c 69 63 61 74 69 6f 6e |ame?.App|lication|
|00004110| 73 20 74 68 61 74 20 64 | 6f 20 74 68 69 73 20 64 |s that d|o this d|
|00004120| 6f 20 6e 6f 74 20 77 6f | 72 6b 20 63 6f 72 72 65 |o not wo|rk corre|
|00004130| 63 74 6c 79 20 75 6e 64 | 65 72 20 48 46 53 20 28 |ctly und|er HFS (|
|00004140| 69 6e 20 66 61 63 74 2c | 20 74 68 65 79 20 64 6f |in fact,| they do|
|00004150| 20 6e 6f 74 20 65 76 65 | 6e 20 72 75 6e 20 63 6f | not eve|n run co|
|00004160| 72 72 65 63 74 6c 79 20 | 75 6e 64 65 72 20 4d 46 |rrectly |under MF|
|00004170| 53 29 2e 20 49 6e 73 74 | 65 61 64 20 6f 66 20 74 |S). Inst|ead of t|
|00004180| 68 69 73 2c 20 75 73 65 | 20 61 20 76 52 65 66 4e |his, use| a vRefN|
|00004190| 75 6d 20 74 6f 20 61 63 | 63 65 73 73 20 61 20 76 |um to ac|cess a v|
|000041a0| 6f 6c 75 6d 65 20 6f 72 | 20 61 20 64 69 72 65 63 |olume or| a direc|
|000041b0| 74 6f 72 79 2e 20 46 75 | 6c 6c 79 20 71 75 61 6c |tory. Fu|lly qual|
|000041c0| 69 66 69 65 64 20 70 61 | 74 68 6e 61 6d 65 73 20 |ified pa|thnames |
|000041d0| 28 73 75 63 68 20 61 73 | 20 76 6f 6c 75 6d 65 3a |(such as| volume:|
|000041e0| 66 6f 6c 64 65 72 31 3a | 66 6f 6c 64 65 72 32 3a |folder1:|folder2:|
|000041f0| 66 69 6c 65 6e 61 6d 65 | 29 20 77 6f 72 6b 20 63 |filename|) work c|
|00004200| 6f 72 72 65 63 74 6c 79 | 2c 20 62 75 74 20 77 65 |orrectly|, but we|
|00004210| 20 64 6f 6e d5 74 20 72 | 65 63 6f 6d 6d 65 6e 64 | don.t r|ecommend|
|00004220| 20 74 68 61 74 20 79 6f | 75 20 75 73 65 20 74 68 | that yo|u use th|
|00004230| 65 6d 2e 20 50 6c 65 61 | 73 65 20 64 6f 6e d5 74 |em. Plea|se don.t|
|00004240| 20 65 76 65 72 20 6d 61 | 6b 65 20 61 20 75 73 65 | ever ma|ke a use|
|00004250| 72 20 74 79 70 65 20 69 | 6e 20 61 20 66 75 6c 6c |r type i|n a full|
|00004260| 20 70 61 74 68 6e 61 6d | 65 21 20 0d 41 72 65 20 | pathnam|e! .Are |
|00004270| 79 6f 75 20 73 65 61 72 | 63 68 69 6e 67 20 64 69 |you sear|ching di|
|00004280| 72 65 63 74 6f 72 69 65 | 73 20 66 6f 72 20 66 69 |rectorie|s for fi|
|00004290| 6c 65 73 20 75 73 69 6e | 67 20 61 20 6c 6f 6f 70 |les usin|g a loop|
|000042a0| 20 73 75 63 68 20 61 73 | 09 09 46 4f 52 20 69 6e | such as|..FOR in|
|000042b0| 64 65 78 3a 3d 20 31 20 | 74 6f 20 69 6f 56 4e 6d |dex:= 1 |to ioVNm|
|000042c0| 46 6c 73 20 44 4f 20 2e | 2e 2e 09 0d 77 68 65 72 |Fls DO .|....wher|
|000042d0| 65 20 69 6f 56 4e 6d 46 | 6c 73 20 77 61 73 20 72 |e ioVNmF|ls was r|
|000042e0| 65 74 75 72 6e 65 64 20 | 66 72 6f 6d 20 61 20 50 |eturned |from a P|
|000042f0| 42 47 65 74 56 69 6e 66 | 6f 20 63 61 6c 6c 3f 0d |BGetVinf|o call?.|
|00004300| 54 68 69 73 20 74 65 63 | 68 6e 69 71 75 65 20 73 |This tec|hnique s|
|00004310| 68 6f 75 6c 64 20 6e 6f | 74 20 62 65 20 75 73 65 |hould no|t be use|
|00004320| 64 2e 20 49 6e 73 74 65 | 61 64 2c 20 75 73 65 20 |d. Inste|ad, use |
|00004330| 72 65 70 65 61 74 65 64 | 20 63 61 6c 6c 73 20 74 |repeated| calls t|
|00004340| 6f 20 50 42 47 65 74 46 | 49 6e 66 6f 20 75 73 69 |o PBGetF|Info usi|
|00004350| 6e 67 20 69 6f 46 44 69 | 72 49 6e 64 65 78 20 75 |ng ioFDi|rIndex u|
|00004360| 6e 74 69 6c 20 66 6e 66 | 45 72 72 20 69 73 20 72 |ntil fnf|Err is r|
|00004370| 65 74 75 72 6e 65 64 2e | 20 49 6e 64 65 78 65 64 |eturned.| Indexed|
|00004380| 20 63 61 6c 6c 73 20 74 | 6f 20 50 42 47 65 74 46 | calls t|o PBGetF|
|00004390| 49 6e 66 6f 20 77 69 6c | 6c 20 72 65 74 75 72 6e |Info wil|l return|
|000043a0| 20 66 69 6c 65 73 20 69 | 6e 20 74 68 65 20 64 69 | files i|n the di|
|000043b0| 72 65 63 74 6f 72 79 20 | 73 70 65 63 69 66 69 65 |rectory |specifie|
|000043c0| 64 20 62 79 20 74 68 65 | 20 76 52 65 66 4e 75 6d |d by the| vRefNum|
|000043d0| 20 74 68 61 74 20 79 6f | 75 20 70 75 74 20 69 6e | that yo|u put in|
|000043e0| 20 74 68 65 20 70 61 72 | 61 6d 65 74 65 72 20 62 | the par|ameter b|
|000043f0| 6c 6f 63 6b 2e 0d 41 72 | 65 20 79 6f 75 20 61 73 |lock..Ar|e you as|
|00004400| 73 75 6d 69 6e 67 20 74 | 68 61 74 20 61 20 76 52 |suming t|hat a vR|
|00004410| 65 66 4e 75 6d 20 77 69 | 6c 6c 20 61 63 74 75 61 |efNum wi|ll actua|
|00004420| 6c 6c 79 20 72 65 66 65 | 72 20 74 6f 20 61 20 76 |lly refe|r to a v|
|00004430| 6f 6c 75 6d 65 3f 0d 41 | 20 76 52 65 66 4e 75 6d |olume?.A| vRefNum|
|00004440| 20 63 61 6e 20 6e 6f 77 | 20 62 65 20 61 20 57 44 | can now| be a WD|
|00004450| 52 65 66 4e 75 6d 2e 20 | 41 20 57 44 52 65 66 4e |RefNum. |A WDRefN|
|00004460| 75 6d 20 69 6e 64 69 63 | 61 74 65 73 20 77 68 69 |um indic|ates whi|
|00004470| 63 68 20 77 6f 72 6b 69 | 6e 67 20 64 69 72 65 63 |ch worki|ng direc|
|00004480| 74 6f 72 79 20 28 66 6f | 6c 64 65 72 29 20 61 20 |tory (fo|lder) a |
|00004490| 66 69 6c 65 20 69 73 20 | 69 6e 2c 20 6e 6f 74 20 |file is |in, not |
|000044a0| 77 68 69 63 68 20 76 6f | 6c 75 6d 65 20 74 68 65 |which vo|lume the|
|000044b0| 20 66 69 6c 65 20 69 73 | 20 6f 6e 2e 20 44 6f 6e | file is| on. Don|
|000044c0| d5 74 20 74 68 69 6e 6b | 20 6f 66 20 61 20 76 52 |.t think| of a vR|
|000044d0| 65 66 4e 75 6d 20 61 73 | 20 61 20 77 61 79 20 74 |efNum as| a way t|
|000044e0| 6f 20 61 63 63 65 73 73 | 20 61 20 76 6f 6c 75 6d |o access| a volum|
|000044f0| 65 2c 20 62 75 74 20 72 | 61 74 68 65 72 20 61 73 |e, but r|ather as|
|00004500| 20 61 20 6d 65 61 6e 73 | 20 6f 66 20 74 65 6c 6c | a means| of tell|
|00004510| 69 6e 67 20 74 68 65 20 | 66 69 6c 65 20 73 79 73 |ing the |file sys|
|00004520| 74 65 6d 20 77 68 65 72 | 65 20 74 6f 20 66 69 6e |tem wher|e to fin|
|00004530| 64 20 61 20 66 69 6c 65 | 2e 20 0d 41 72 65 20 79 |d a file|. .Are y|
|00004540| 6f 75 20 77 61 6c 6b 69 | 6e 67 20 74 68 72 6f 75 |ou walki|ng throu|
|00004550| 67 68 20 74 68 65 20 56 | 43 42 20 71 75 65 75 65 |gh the V|CB queue|
|00004560| 3f 0d 59 6f 75 20 73 68 | 6f 75 6c 64 20 6c 65 74 |?.You sh|ould let|
|00004570| 20 75 73 20 64 6f 20 74 | 68 65 20 77 61 6c 6b 69 | us do t|he walki|
|00004580| 6e 67 20 66 6f 72 20 79 | 6f 75 2e 20 55 73 69 6e |ng for y|ou. Usin|
|00004590| 67 20 69 6e 64 65 78 65 | 64 20 63 61 6c 6c 73 20 |g indexe|d calls |
|000045a0| 74 6f 20 50 42 47 65 74 | 56 49 6e 66 6f 20 77 69 |to PBGet|VInfo wi|
|000045b0| 6c 6c 20 61 6c 6c 6f 77 | 20 79 6f 75 20 74 6f 20 |ll allow| you to |
|000045c0| 67 65 74 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |get info|rmation |
|000045d0| 61 62 6f 75 74 20 61 6e | 79 20 6d 6f 75 6e 74 65 |about an|y mounte|
|000045e0| 64 20 76 6f 6c 75 6d 65 | 2e 20 59 6f 75 20 73 68 |d volume|. You sh|
|000045f0| 6f 75 6c 64 6e d5 74 20 | 77 61 6c 6b 20 74 68 72 |ouldn.t |walk thr|
|00004600| 6f 75 67 68 20 74 68 65 | 20 56 43 42 20 71 75 65 |ough the| VCB que|
|00004610| 75 65 20 62 65 63 61 75 | 73 65 20 69 74 20 63 68 |ue becau|se it ch|
|00004620| 61 6e 67 65 64 20 66 6f | 72 20 48 46 53 20 61 6e |anged fo|r HFS an|
|00004630| 64 20 6d 69 67 68 74 20 | 63 68 61 6e 67 65 20 69 |d might |change i|
|00004640| 6e 20 74 68 65 20 66 75 | 74 75 72 65 2e 20 54 68 |n the fu|ture. Th|
|00004650| 65 20 72 6f 75 74 69 6e | 65 73 20 74 68 61 74 20 |e routin|es that |
|00004660| 77 65 20 73 75 70 70 6c | 79 20 77 69 6c 6c 20 63 |we suppl|y will c|
|00004670| 6f 72 72 65 63 74 6c 79 | 20 61 63 63 65 73 73 20 |orrectly| access |
|00004680| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 69 6e 20 74 |informat|ion in t|
|00004690| 68 65 20 56 43 42 20 71 | 75 65 75 65 2e 20 0d 41 |he VCB q|ueue. .A|
|000046a0| 72 65 20 79 6f 75 20 75 | 73 69 6e 67 20 74 68 65 |re you u|sing the|
|000046b0| 20 66 69 6c 65 20 73 79 | 73 74 65 6d d5 73 20 d2 | file sy|stem.s .|
|000046c0| 49 4d 4d 45 44 d3 20 62 | 69 74 3f 20 28 61 73 73 |IMMED. b|it? (ass|
|000046d0| 65 6d 62 6c 79 20 6c 61 | 6e 67 75 61 67 65 20 6f |embly la|nguage o|
|000046e0| 6e 6c 79 29 0d 49 6e 73 | 69 64 65 20 4d 61 63 69 |nly).Ins|ide Maci|
|000046f0| 6e 74 6f 73 68 20 64 65 | 73 63 72 69 62 65 73 20 |ntosh de|scribes |
|00004700| 62 69 74 20 39 20 6f 66 | 20 74 68 65 20 74 72 61 |bit 9 of| the tra|
|00004710| 70 20 77 6f 72 64 20 61 | 73 20 74 68 65 20 69 6d |p word a|s the im|
|00004720| 6d 65 64 69 61 74 65 20 | 62 69 74 2e 20 49 6e 20 |mediate |bit. In |
|00004730| 66 61 63 74 2c 20 73 65 | 74 74 69 6e 67 20 74 68 |fact, se|tting th|
|00004740| 69 73 20 62 69 74 20 75 | 6e 64 65 72 20 4d 46 53 |is bit u|nder MFS|
|00004750| 20 64 69 64 20 6e 6f 74 | 20 77 6f 72 6b 20 61 73 | did not| work as|
|00004760| 20 64 6f 63 75 6d 65 6e | 74 65 64 3b 20 69 74 20 | documen|ted; it |
|00004770| 64 69 64 20 6e 6f 74 20 | 68 61 76 65 20 74 68 65 |did not |have the|
|00004780| 20 64 65 73 69 72 65 64 | 20 65 66 66 65 63 74 20 | desired| effect |
|00004790| 6f 66 20 62 79 70 61 73 | 73 69 6e 67 20 74 68 65 |of bypas|sing the|
|000047a0| 20 66 69 6c 65 20 49 2f | 4f 20 71 75 65 75 65 2e | file I/|O queue.|
|000047b0| 20 55 6e 64 65 72 20 48 | 46 53 2c 20 74 68 69 73 | Under H|FS, this|
|000047c0| 20 62 69 74 20 69 73 20 | 75 73 65 64 3b 20 69 74 | bit is |used; it|
|000047d0| 20 64 69 73 74 69 6e 67 | 75 69 73 68 65 73 20 48 | disting|uishes H|
|000047e0| 46 53 20 76 61 72 69 65 | 74 69 65 73 20 6f 66 20 |FS varie|ties of |
|000047f0| 63 61 6c 6c 73 20 66 72 | 6f 6d 20 4d 46 53 20 76 |calls fr|om MFS v|
|00004800| 61 72 69 65 74 69 65 73 | 2e 20 46 6f 72 20 65 78 |arieties|. For ex|
|00004810| 61 6d 70 6c 65 2c 20 74 | 68 65 20 50 42 4f 70 65 |ample, t|he PBOpe|
|00004820| 6e 20 63 61 6c 6c 20 68 | 61 73 20 74 68 69 73 20 |n call h|as this |
|00004830| 62 69 74 20 63 6c 65 61 | 72 3b 20 50 42 48 4f 70 |bit clea|r; PBHOp|
|00004840| 65 6e 20 68 61 73 20 69 | 74 20 73 65 74 2e 20 54 |en has i|t set. T|
|00004850| 68 65 72 65 66 6f 72 65 | 2c 20 79 6f 75 20 6d 75 |herefore|, you mu|
|00004860| 73 74 20 62 65 20 73 75 | 72 65 20 74 68 61 74 20 |st be su|re that |
|00004870| 79 6f 75 72 20 66 69 6c | 65 20 73 79 73 74 65 6d |your fil|e system|
|00004880| 20 63 61 6c 6c 73 20 64 | 6f 20 6e 6f 74 20 75 73 | calls d|o not us|
|00004890| 65 20 74 68 69 73 20 62 | 69 74 20 61 73 20 74 68 |e this b|it as th|
|000048a0| 65 20 69 6d 6d 65 64 69 | 61 74 65 20 62 69 74 2e |e immedi|ate bit.|
|000048b0| 0d 46 75 72 74 68 65 72 | 20 52 65 66 65 72 65 6e |.Further| Referen|
|000048c0| 63 65 3a 0d a5 09 54 68 | 65 20 46 69 6c 65 20 4d |ce:...Th|e File M|
|000048d0| 61 6e 61 67 65 72 0d 4e | 6f 74 69 63 65 3a 20 54 |anager.N|otice: T|
|000048e0| 68 65 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 69 |he infor|mation i|
|000048f0| 6e 20 74 68 69 73 20 54 | 65 63 68 6e 69 63 61 6c |n this T|echnical|
|00004900| 20 4e 6f 74 65 20 63 61 | 6e 20 6e 6f 77 20 62 65 | Note ca|n now be|
|00004910| 20 66 6f 75 6e 64 20 69 | 6e 20 49 6e 73 69 64 65 | found i|n Inside|
|00004920| 20 4d 61 63 69 6e 74 6f | 73 68 3a 46 69 6c 65 73 | Macinto|sh:Files|
|00004930| 3b 20 74 68 65 20 64 69 | 73 63 75 73 73 69 6f 6e |; the di|scussion|
|00004940| 20 6f 66 20 4d 75 6c 74 | 69 70 6c 65 20 43 6c 6f | of Mult|iple Clo|
|00004950| 73 65 73 20 63 61 6e 20 | 62 65 20 66 6f 75 6e 64 |ses can |be found|
|00004960| 20 6f 6e 20 32 2d 38 31 | 2c 20 22 2e 46 69 6c 65 | on 2-81|, ".File|
|00004970| 6e 61 6d 65 73 22 20 61 | 72 65 20 6e 6f 77 20 68 |names" a|re now h|
|00004980| 61 6e 64 6c 65 64 20 63 | 6f 72 72 65 63 74 6c 79 |andled c|orrectly|
|00004990| 20 62 79 20 50 42 4f 70 | 65 6e 44 46 2c 20 61 6e | by PBOp|enDF, an|
|000049a0| 64 20 74 68 65 20 64 69 | 73 63 75 73 73 69 6f 6e |d the di|scussion|
|000049b0| 20 6f 66 20 46 69 6c 65 | 54 79 70 65 73 20 63 61 | of File|Types ca|
|000049c0| 6e 20 62 65 20 66 6f 75 | 6e 64 20 6f 6e 20 32 2d |n be fou|nd on 2-|
|000049d0| 39 35 2e 20 20 54 68 69 | 73 20 6e 6f 74 65 20 77 |95. Thi|s note w|
|000049e0| 69 6c 6c 20 62 65 20 72 | 65 6d 6f 76 65 64 20 66 |ill be r|emoved f|
|000049f0| 72 6f 6d 20 74 68 65 20 | 54 65 63 68 6e 69 63 61 |rom the |Technica|
|00004a00| 6c 20 4e 6f 74 65 20 6c | 69 62 72 61 72 79 20 69 |l Note l|ibrary i|
|00004a10| 6e 20 74 68 65 20 6e 65 | 61 72 20 66 75 74 75 72 |n the ne|ar futur|
|00004a20| 65 2e 0d 46 4c 20 36 20 | 2d 20 48 46 53 20 45 6c |e..FL 6 |- HFS El|
|00004a30| 75 63 69 64 61 74 69 6f | 6e 73 0d 46 69 6c 65 73 |ucidatio|ns.Files|
|00004a40| 09 09 0d 52 65 76 69 73 | 65 64 20 62 79 3a 09 09 |...Revis|ed by:..|
|00004a50| 4d 61 72 63 68 20 31 39 | 38 38 0d 57 72 69 74 74 |March 19|88.Writt|
|00004a60| 65 6e 20 62 79 3a 09 42 | 72 79 61 6e 20 22 42 6f |en by:.B|ryan "Bo|
|00004a70| 62 22 20 4a 6f 68 6e 73 | 6f 6e 09 4a 61 6e 75 61 |b" Johns|on.Janua|
|00004a80| 72 79 20 31 32 2c 20 31 | 39 38 37 0d 54 68 69 73 |ry 12, 1|987.This|
|00004a90| 20 74 65 63 68 6e 69 63 | 61 6c 20 6e 6f 74 65 20 | technic|al note |
|00004aa0| 77 69 6c 6c 20 64 65 73 | 63 72 69 62 65 20 61 20 |will des|cribe a |
|00004ab0| 66 65 77 20 70 72 6f 62 | 6c 65 6d 73 20 74 68 61 |few prob|lems tha|
|00004ac0| 74 20 63 61 6e 20 6f 63 | 63 75 72 20 77 68 69 6c |t can oc|cur whil|
|00004ad0| 65 20 75 73 69 6e 67 20 | 48 46 53 2e 20 49 74 20 |e using |HFS. It |
|00004ae0| 77 69 6c 6c 20 61 6c 73 | 6f 20 64 65 73 63 72 69 |will als|o descri|
|00004af0| 62 65 20 77 61 79 73 20 | 74 6f 20 61 76 6f 69 64 |be ways |to avoid|
|00004b00| 20 74 68 65 73 65 20 70 | 72 6f 62 6c 65 6d 73 2e | these p|roblems.|
|00004b10| 0d 54 68 69 73 20 74 65 | 63 68 6e 69 63 61 6c 20 |.This te|chnical |
|00004b20| 6e 6f 74 65 20 77 69 6c | 6c 20 64 69 73 63 75 73 |note wil|l discus|
|00004b30| 73 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |s the fo|llowing |
|00004b40| 70 72 6f 62 6c 65 6d 73 | 3a 0d 31 29 20 49 74 20 |problems|:.1) It |
|00004b50| 69 73 20 76 65 72 79 20 | 69 6d 70 6f 72 74 61 6e |is very |importan|
|00004b60| 74 20 74 6f 20 62 65 20 | 63 61 72 65 66 75 6c 20 |t to be |careful |
|00004b70| 61 62 6f 75 74 20 68 6f | 77 20 66 69 6c 65 73 20 |about ho|w files |
|00004b80| 61 72 65 20 6f 70 65 6e | 65 64 20 61 6e 64 20 63 |are open|ed and c|
|00004b90| 6c 6f 73 65 64 2e 20 54 | 68 65 72 65 20 6d 75 73 |losed. T|here mus|
|00004ba0| 74 20 62 65 20 6e 6f 20 | 6d 6f 72 65 20 74 68 61 |t be no |more tha|
|00004bb0| 6e 20 6f 6e 65 20 63 6c | 6f 73 65 20 66 6f 72 20 |n one cl|ose for |
|00004bc0| 65 76 65 72 79 20 6f 70 | 65 6e 2e 20 0d 32 29 20 |every op|en. .2) |
|00004bd0| 44 6f 6e d5 74 20 75 73 | 65 20 44 72 69 76 65 72 |Don.t us|e Driver|
|00004be0| 20 6e 61 6d 65 73 2c 20 | 6c 69 6b 65 20 2e 42 6f | names, |like .Bo|
|00004bf0| 75 74 2c 20 2e 50 72 69 | 6e 74 20 6f 72 20 2e 53 |ut, .Pri|nt or .S|
|00004c00| 6f 6e 79 2c 20 69 6e 20 | 70 6c 61 63 65 20 6f 66 |ony, in |place of|
|00004c10| 20 66 69 6c 65 20 6e 61 | 6d 65 73 20 6f 72 20 74 | file na|mes or t|
|00004c20| 68 65 20 66 69 6c 65 20 | 73 79 73 74 65 6d 20 77 |he file |system w|
|00004c30| 69 6c 6c 20 62 65 63 6f | 6d 65 20 63 6f 6e 66 75 |ill beco|me confu|
|00004c40| 73 65 64 2e 0d 33 29 20 | 42 65 20 61 77 61 72 65 |sed..3) |Be aware|
|00004c50| 20 6f 66 20 74 68 65 20 | 69 6f 46 6c 56 65 72 73 | of the |ioFlVers|
|00004c60| 4e 75 6d 20 62 79 74 65 | 20 69 6e 20 61 6c 6c 20 |Num byte| in all |
|00004c70| 66 69 6c 65 20 63 61 6c | 6c 73 2e 20 41 20 6e 75 |file cal|ls. A nu|
|00004c80| 6d 62 65 72 20 6f 66 20 | 70 69 65 63 65 73 20 6f |mber of |pieces o|
|00004c90| 66 20 74 68 65 20 4d 61 | 63 69 6e 74 6f 73 68 20 |f the Ma|cintosh |
|00004ca0| 73 79 73 74 65 6d 20 64 | 6f 20 6e 6f 74 20 75 73 |system d|o not us|
|00004cb0| 65 2c 20 61 6e 64 20 6d | 61 79 20 69 6e 20 66 61 |e, and m|ay in fa|
|00004cc0| 63 74 20 69 67 6e 6f 72 | 65 2c 20 66 69 6c 65 73 |ct ignor|e, files|
|00004cd0| 20 63 72 65 61 74 65 64 | 20 77 69 74 68 20 6e 6f | created| with no|
|00004ce0| 6e 2d 7a 65 72 6f 20 69 | 6f 46 6c 56 65 72 73 4e |n-zero i|oFlVersN|
|00004cf0| 75 6d 73 2e 0d 45 61 63 | 68 20 6f 66 20 74 68 65 |ums..Eac|h of the|
|00004d00| 73 65 20 63 61 6e 20 6c | 65 61 64 20 74 6f 20 73 |se can l|ead to s|
|00004d10| 74 72 61 6e 67 65 20 6f | 63 63 75 72 72 65 6e 63 |trange o|ccurrenc|
|00004d20| 65 73 2c 20 61 73 20 77 | 65 6c 6c 20 61 73 20 70 |es, as w|ell as p|
|00004d30| 72 6f 62 6c 65 6d 73 20 | 66 6f 72 20 74 68 65 20 |roblems |for the |
|00004d40| 75 73 65 72 73 2e 20 44 | 6f 69 6e 67 20 61 6e 79 |users. D|oing any|
|00004d50| 20 6f 72 20 61 6c 6c 20 | 6f 66 20 74 68 65 73 65 | or all |of these|
|00004d60| 20 6d 61 72 67 69 6e 61 | 6c 6c 79 20 69 6c 6c 65 | margina|lly ille|
|00004d70| 67 61 6c 20 6f 70 65 72 | 61 74 69 6f 6e 73 20 77 |gal oper|ations w|
|00004d80| 69 6c 6c 20 6e 6f 74 20 | 6e 65 63 65 73 73 61 72 |ill not |necessar|
|00004d90| 69 6c 79 20 6c 65 61 64 | 20 74 6f 20 61 20 53 79 |ily lead| to a Sy|
|00004da0| 73 74 65 6d 20 45 72 72 | 6f 72 2e 20 49 6e 20 73 |stem Err|or. In s|
|00004db0| 6f 6d 65 20 63 61 73 65 | 73 20 74 68 65 20 63 6f |ome case|s the co|
|00004dc0| 6e 66 75 73 69 6f 6e 20 | 67 65 6e 65 72 61 74 65 |nfusion |generate|
|00004dd0| 64 20 6d 61 79 20 62 65 | 20 77 6f 72 73 65 20 74 |d may be| worse t|
|00004de0| 68 61 6e 20 61 20 53 79 | 73 74 65 6d 20 45 72 72 |han a Sy|stem Err|
|00004df0| 6f 72 2e 0d 4f 6e 65 20 | 43 6c 6f 73 65 20 69 73 |or..One |Close is|
|00004e00| 20 61 6c 77 61 79 73 20 | 65 6e 6f 75 67 68 0d 49 | always |enough.I|
|00004e10| 66 20 61 20 66 69 6c 65 | 20 69 73 20 63 6c 6f 73 |f a file| is clos|
|00004e20| 65 64 20 74 77 69 63 65 | 2c 20 69 74 20 69 73 20 |ed twice|, it is |
|00004e30| 70 6f 73 73 69 62 6c 65 | 20 74 6f 20 63 6f 72 72 |possible| to corr|
|00004e40| 75 70 74 20 74 68 65 20 | 66 69 6c 65 20 73 79 73 |upt the |file sys|
|00004e50| 74 65 6d 20 6f 6e 20 61 | 20 64 69 73 6b 2e 20 49 |tem on a| disk. I|
|00004e60| 66 20 61 20 70 72 6f 67 | 72 61 6d 20 68 61 73 20 |f a prog|ram has |
|00004e70| 62 65 65 6e 20 63 72 65 | 61 74 69 6e 67 20 75 6e |been cre|ating un|
|00004e80| 72 65 61 64 61 62 6c 65 | 20 64 69 73 6b 73 2c 20 |readable| disks, |
|00004e90| 74 68 69 73 20 6d 61 79 | 20 62 65 20 74 68 65 20 |this may| be the |
|00004ea0| 63 61 75 73 65 2e 0d 4f | 6e 65 20 61 73 70 65 63 |cause..O|ne aspec|
|00004eb0| 74 20 6f 66 20 74 68 65 | 20 66 69 6c 65 20 73 79 |t of the| file sy|
|00004ec0| 73 74 65 6d 20 74 68 61 | 74 20 69 73 20 6e 6f 74 |stem tha|t is not|
|00004ed0| 20 77 65 6c 6c 20 64 6f | 63 75 6d 65 6e 74 65 64 | well do|cumented|
|00004ee0| 20 69 73 20 68 6f 77 20 | 69 74 20 61 6c 6c 6f 63 | is how |it alloc|
|00004ef0| 61 74 65 73 20 61 63 63 | 65 73 73 20 70 61 74 68 |ates acc|ess path|
|00004f00| 73 20 74 6f 20 66 69 6c | 65 73 20 74 68 61 74 20 |s to fil|es that |
|00004f10| 61 72 65 20 63 75 72 72 | 65 6e 74 6c 79 20 6f 70 |are curr|ently op|
|00004f20| 65 6e 2e 20 41 73 20 61 | 20 72 65 73 75 6c 74 20 |en. As a| result |
|00004f30| 6f 66 20 74 68 69 73 2c | 20 69 74 20 69 73 20 70 |of this,| it is p|
|00004f40| 6f 73 73 69 62 6c 65 20 | 74 6f 20 67 65 74 20 61 |ossible |to get a|
|00004f50| 20 72 61 74 68 65 72 20 | 63 61 76 61 6c 69 65 72 | rather |cavalier|
|00004f60| 20 61 74 74 69 74 75 64 | 65 20 61 62 6f 75 74 20 | attitud|e about |
|00004f70| 6f 70 65 6e 69 6e 67 20 | 61 6e 64 20 63 6c 6f 73 |opening |and clos|
|00004f80| 69 6e 67 20 66 69 6c 65 | 73 2e 20 54 68 69 73 20 |ing file|s. This |
|00004f90| 64 69 73 63 75 73 73 69 | 6f 6e 20 77 69 6c 6c 20 |discussi|on will |
|00004fa0| 65 78 70 6c 61 69 6e 20 | 77 68 79 20 69 74 20 69 |explain |why it i|
|00004fb0| 73 20 6e 65 63 65 73 73 | 61 72 79 20 74 6f 20 62 |s necess|ary to b|
|00004fc0| 65 20 76 65 72 79 20 63 | 61 72 65 66 75 6c 20 61 |e very c|areful a|
|00004fd0| 62 6f 75 74 20 6f 70 65 | 6e 69 6e 67 20 61 6e 64 |bout ope|ning and|
|00004fe0| 20 63 6c 6f 73 69 6e 67 | 20 66 69 6c 65 73 2e 0d | closing| files..|
|00004ff0| 57 68 65 6e 20 74 68 65 | 20 46 69 6c 65 20 4d 61 |When the| File Ma|
|00005000| 6e 61 67 65 72 20 72 65 | 63 65 69 76 65 73 20 61 |nager re|ceives a|
|00005010| 6e 20 4f 70 65 6e 20 63 | 61 6c 6c 2c 20 69 74 20 |n Open c|all, it |
|00005020| 77 69 6c 6c 20 6c 6f 6f | 6b 20 61 74 20 74 68 65 |will loo|k at the|
|00005030| 20 70 61 72 61 6d 65 74 | 65 72 73 20 70 61 73 73 | paramet|ers pass|
|00005040| 65 64 20 69 6e 20 74 68 | 65 20 70 61 72 61 6d 65 |ed in th|e parame|
|00005050| 74 65 72 20 62 6c 6f 63 | 6b 20 61 6e 64 20 63 72 |ter bloc|k and cr|
|00005060| 65 61 74 65 20 61 20 6e | 65 77 20 61 63 63 65 73 |eate a n|ew acces|
|00005070| 73 20 70 61 74 68 20 66 | 6f 72 20 74 68 65 20 66 |s path f|or the f|
|00005080| 69 6c 65 20 74 68 61 74 | 20 69 73 20 62 65 69 6e |ile that| is bein|
|00005090| 67 20 6f 70 65 6e 65 64 | 2e 20 54 68 65 20 61 63 |g opened|. The ac|
|000050a0| 63 65 73 73 20 70 61 74 | 68 20 69 73 20 68 6f 77 |cess pat|h is how|
|000050b0| 20 74 68 65 20 46 69 6c | 65 20 4d 61 6e 61 67 65 | the Fil|e Manage|
|000050c0| 72 20 6b 65 65 70 73 20 | 74 72 61 63 6b 20 6f 66 |r keeps |track of|
|000050d0| 20 77 68 65 72 65 20 74 | 6f 20 73 65 6e 64 20 64 | where t|o send d|
|000050e0| 61 74 61 20 74 68 61 74 | 20 69 73 20 77 72 69 74 |ata that| is writ|
|000050f0| 74 65 6e 2c 20 61 6e 64 | 20 77 68 65 72 65 20 74 |ten, and| where t|
|00005100| 6f 20 67 65 74 20 64 61 | 74 61 20 74 68 61 74 20 |o get da|ta that |
|00005110| 69 73 20 72 65 61 64 20 | 66 72 6f 6d 20 74 68 61 |is read |from tha|
|00005120| 74 20 66 69 6c 65 2e 20 | 41 6e 20 61 63 63 65 73 |t file. |An acces|
|00005130| 73 20 70 61 74 68 20 69 | 73 20 6e 6f 74 68 69 6e |s path i|s nothin|
|00005140| 67 20 6d 6f 72 65 20 74 | 68 61 6e 3a 20 31 29 20 |g more t|han: 1) |
|00005150| 61 20 62 75 66 66 65 72 | 20 74 68 61 74 20 74 68 |a buffer| that th|
|00005160| 65 20 66 69 6c 65 20 73 | 79 73 74 65 6d 20 75 73 |e file s|ystem us|
|00005170| 65 73 20 74 6f 20 72 65 | 61 64 20 61 6e 64 20 77 |es to re|ad and w|
|00005180| 72 69 74 65 20 64 61 74 | 61 2c 20 61 6e 64 20 32 |rite dat|a, and 2|
|00005190| 29 20 61 20 46 69 6c 65 | 20 43 6f 6e 74 72 6f 6c |) a File| Control|
|000051a0| 20 42 6c 6f 63 6b 20 74 | 68 61 74 20 64 65 73 63 | Block t|hat desc|
|000051b0| 72 69 62 65 73 20 68 6f | 77 20 74 68 65 20 66 69 |ribes ho|w the fi|
|000051c0| 6c 65 20 69 73 20 73 74 | 6f 72 65 64 20 6f 6e 20 |le is st|ored on |
|000051d0| 61 20 64 69 73 6b 2e 0d | 41 20 63 61 6c 6c 20 6c |a disk..|A call l|
|000051e0| 69 6b 65 3a 0d 09 45 72 | 72 53 74 75 66 66 20 3a |ike:..Er|rStuff :|
|000051f0| 3d 20 46 53 4f 70 65 6e | 20 28 27 46 69 72 73 74 |= FSOpen| ('First|
|00005200| 46 69 6c 65 27 2c 20 74 | 68 65 56 52 65 66 4e 75 |File', t|heVRefNu|
|00005210| 6d 2c 20 46 69 72 73 74 | 52 65 66 4e 75 6d 29 3b |m, First|RefNum);|
|00005220| 0d 77 69 6c 6c 20 63 72 | 65 61 74 65 20 74 68 65 |.will cr|eate the|
|00005230| 20 61 63 63 65 73 73 20 | 70 61 74 68 20 61 73 20 | access |path as |
|00005240| 61 20 62 75 66 66 65 72 | 20 61 6e 64 20 61 20 46 |a buffer| and a F|
|00005250| 69 6c 65 20 43 6f 6e 74 | 72 6f 6c 20 42 6c 6f 63 |ile Cont|rol Bloc|
|00005260| 6b 20 28 46 43 42 29 20 | 69 6e 20 74 68 65 20 46 |k (FCB) |in the F|
|00005270| 43 42 20 71 75 65 75 65 | 2e 20 0d 4e 6f 74 65 3a |CB queue|. .Note:|
|00005280| 20 54 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 69 | The fol|lowing i|
|00005290| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 69 73 20 68 65 |nformati|on is he|
|000052a0| 72 65 20 66 6f 72 20 69 | 6c 6c 75 73 74 72 61 74 |re for i|llustrat|
|000052b0| 69 76 65 20 70 75 72 70 | 6f 73 65 73 20 6f 6e 6c |ive purp|oses onl|
|000052c0| 79 3b 20 64 65 70 65 6e | 64 65 6e 63 65 20 6f 6e |y; depen|dence on|
|000052d0| 20 69 74 20 6d 61 79 20 | 63 61 75 73 65 20 63 6f | it may |cause co|
|000052e0| 6d 70 61 74 69 62 69 6c | 69 74 79 20 70 72 6f 62 |mpatibil|ity prob|
|000052f0| 6c 65 6d 73 20 77 69 74 | 68 20 66 75 74 75 72 65 |lems wit|h future|
|00005300| 20 73 79 73 74 65 6d 20 | 73 6f 66 74 77 61 72 65 | system |software|
|00005310| 2e 0d 54 68 65 20 73 74 | 72 75 63 74 75 72 65 20 |..The st|ructure |
|00005320| 6f 66 20 74 68 65 20 71 | 75 65 75 65 20 63 61 6e |of the q|ueue can|
|00005330| 20 62 65 20 76 69 73 75 | 61 6c 69 7a 65 64 20 61 | be visu|alized a|
|00005340| 73 3a 0d 77 68 65 72 65 | 20 46 43 42 53 50 74 72 |s:.where| FCBSPtr|
|00005350| 20 69 73 20 61 20 6c 6f | 77 2d 6d 65 6d 6f 72 79 | is a lo|w-memory|
|00005360| 20 67 6c 6f 62 61 6c 20 | 28 61 74 20 24 33 34 45 | global |(at $34E|
|00005370| 29 20 74 68 61 74 20 68 | 6f 6c 64 73 20 74 68 65 |) that h|olds the|
|00005380| 20 61 64 64 72 65 73 73 | 20 6f 66 20 61 20 6e 6f | address| of a no|
|00005390| 6e 72 65 6c 6f 63 61 74 | 61 62 6c 65 20 62 6c 6f |nrelocat|able blo|
|000053a0| 63 6b 2e 20 54 68 61 74 | 20 62 6c 6f 63 6b 20 69 |ck. That| block i|
|000053b0| 73 20 74 68 65 20 46 69 | 6c 65 20 43 6f 6e 74 72 |s the Fi|le Contr|
|000053c0| 6f 6c 20 42 6c 6f 63 6b | 20 62 75 66 66 65 72 2c |ol Block| buffer,|
|000053d0| 20 61 6e 64 20 69 73 20 | 63 6f 6d 70 6f 73 65 64 | and is |composed|
|000053e0| 20 6f 66 20 74 68 65 20 | 74 77 6f 20 62 79 74 65 | of the |two byte|
|000053f0| 20 68 65 61 64 65 72 20 | 77 68 69 63 68 20 67 69 | header |which gi|
|00005400| 76 65 73 20 74 68 65 20 | 6c 65 6e 67 74 68 20 6f |ves the |length o|
|00005410| 66 20 74 68 65 20 62 6c | 6f 63 6b 2c 20 66 6f 6c |f the bl|ock, fol|
|00005420| 6c 6f 77 65 64 20 62 79 | 20 74 68 65 20 46 43 42 |lowed by| the FCB|
|00005430| 20 72 65 63 6f 72 64 73 | 20 74 68 65 6d 73 65 6c | records| themsel|
|00005440| 76 65 73 2e 20 54 68 65 | 20 72 65 63 6f 72 64 73 |ves. The| records|
|00005450| 20 61 72 65 20 6f 66 20 | 66 69 78 65 64 20 6c 65 | are of |fixed le|
|00005460| 6e 67 74 68 2c 20 61 6e | 64 20 67 69 76 65 20 64 |ngth, an|d give d|
|00005470| 65 74 61 69 6c 65 64 20 | 69 6e 66 6f 72 6d 61 74 |etailed |informat|
|00005480| 69 6f 6e 20 61 62 6f 75 | 74 20 61 6e 20 6f 70 65 |ion abou|t an ope|
|00005490| 6e 20 66 69 6c 65 2e 20 | 41 73 20 64 65 70 69 63 |n file. |As depic|
|000054a0| 74 65 64 2c 20 61 6e 79 | 20 67 69 76 65 6e 20 72 |ted, any| given r|
|000054b0| 65 63 6f 72 64 20 63 61 | 6e 20 62 65 20 66 6f 75 |ecord ca|n be fou|
|000054c0| 6e 64 20 62 79 20 61 64 | 64 69 6e 67 20 74 68 65 |nd by ad|ding the|
|000054d0| 20 6c 65 6e 67 74 68 20 | 6f 66 20 74 68 65 20 70 | length |of the p|
|000054e0| 72 65 76 69 6f 75 73 20 | 46 43 42 20 72 65 63 6f |revious |FCB reco|
|000054f0| 72 64 73 20 74 6f 20 74 | 68 65 20 73 74 61 72 74 |rds to t|he start|
|00005500| 20 6f 66 20 74 68 65 20 | 62 6c 6f 63 6b 2c 20 61 | of the |block, a|
|00005510| 64 64 69 6e 67 20 32 20 | 66 6f 72 20 74 68 65 20 |dding 2 |for the |
|00005520| 74 77 6f 20 62 79 74 65 | 20 68 65 61 64 65 72 3b |two byte| header;|
|00005530| 20 67 69 76 69 6e 67 20 | 61 6e 20 6f 66 66 73 65 | giving |an offse|
|00005540| 74 20 74 6f 20 74 68 65 | 20 72 65 63 6f 72 64 20 |t to the| record |
|00005550| 69 74 73 65 6c 66 2e 20 | 54 68 65 20 73 69 7a 65 |itself. |The size|
|00005560| 20 6f 66 20 74 68 65 20 | 62 6c 6f 63 6b 2c 20 61 | of the |block, a|
|00005570| 6e 64 20 68 65 6e 63 65 | 20 74 68 65 20 6e 75 6d |nd hence| the num|
|00005580| 62 65 72 20 6f 66 20 66 | 69 6c 65 73 20 74 68 61 |ber of f|iles tha|
|00005590| 74 20 63 61 6e 20 62 65 | 20 6f 70 65 6e 20 61 74 |t can be| open at|
|000055a0| 20 61 6e 79 20 67 69 76 | 65 6e 20 74 69 6d 65 2c | any giv|en time,|
|000055b0| 20 69 73 20 64 65 74 65 | 72 6d 69 6e 65 64 20 61 | is dete|rmined a|
|000055c0| 74 20 73 74 61 72 74 75 | 70 20 74 69 6d 65 2e 20 |t startu|p time. |
|000055d0| 54 68 65 20 63 61 6c 6c | 20 74 6f 20 6f 70 65 6e |The call| to open|
|000055e0| 20 d4 46 69 72 73 74 46 | 69 6c 65 d5 20 61 62 6f | .FirstF|ile. abo|
|000055f0| 76 65 20 77 69 6c 6c 20 | 70 61 73 73 20 62 61 63 |ve will |pass bac|
|00005600| 6b 20 74 68 65 20 46 69 | 6c 65 20 52 65 66 65 72 |k the Fi|le Refer|
|00005610| 65 6e 63 65 20 4e 75 6d | 62 65 72 20 74 6f 20 74 |ence Num|ber to t|
|00005620| 68 61 74 20 66 69 6c 65 | 20 69 6e 20 46 69 72 73 |hat file| in Firs|
|00005630| 74 52 65 66 4e 75 6d 2e | 20 54 68 69 73 20 69 73 |tRefNum.| This is|
|00005640| 20 74 68 65 20 6e 75 6d | 62 65 72 20 74 68 61 74 | the num|ber that|
|00005650| 20 77 69 6c 6c 20 62 65 | 20 75 73 65 64 20 74 6f | will be| used to|
|00005660| 20 61 63 63 65 73 73 20 | 74 68 61 74 20 66 69 6c | access |that fil|
|00005670| 65 20 66 72 6f 6d 20 74 | 68 61 74 20 70 6f 69 6e |e from t|hat poin|
|00005680| 74 20 6f 6e 2e 20 54 68 | 65 20 46 69 6c 65 20 4d |t on. Th|e File M|
|00005690| 61 6e 61 67 65 72 20 70 | 61 73 73 65 73 20 62 61 |anager p|asses ba|
|000056a0| 63 6b 20 61 6e 20 6f 66 | 66 73 65 74 20 69 6e 74 |ck an of|fset int|
|000056b0| 6f 20 74 68 65 20 46 43 | 42 20 71 75 65 75 65 20 |o the FC|B queue |
|000056c0| 61 73 20 74 68 65 20 52 | 65 66 4e 75 6d 2e 20 54 |as the R|efNum. T|
|000056d0| 68 69 73 20 6f 66 66 73 | 65 74 20 69 73 20 74 68 |his offs|et is th|
|000056e0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 62 79 74 65 |e number| of byte|
|000056f0| 73 20 70 61 73 74 20 74 | 68 65 20 62 65 67 69 6e |s past t|he begin|
|00005700| 6e 69 6e 67 20 6f 66 20 | 74 68 65 20 71 75 65 75 |ning of |the queu|
|00005710| 65 20 74 6f 20 74 68 61 | 74 20 46 43 42 20 72 65 |e to tha|t FCB re|
|00005720| 63 6f 72 64 20 69 6e 20 | 74 68 65 20 71 75 65 75 |cord in |the queu|
|00005730| 65 2e 20 54 68 61 74 20 | 46 43 42 20 72 65 63 6f |e. That |FCB reco|
|00005740| 72 64 20 77 69 6c 6c 20 | 64 65 73 63 72 69 62 65 |rd will |describe|
|00005750| 20 74 68 65 20 66 69 6c | 65 20 74 68 61 74 20 77 | the fil|e that w|
|00005760| 61 73 20 6f 70 65 6e 65 | 64 2e 20 41 6e 20 65 78 |as opene|d. An ex|
|00005770| 61 6d 70 6c 65 20 6f 66 | 20 61 20 6e 75 6d 62 65 |ample of| a numbe|
|00005780| 72 20 74 68 61 74 20 6d | 69 67 68 74 20 67 65 74 |r that m|ight get|
|00005790| 20 70 61 73 73 65 64 20 | 62 61 63 6b 20 61 73 20 | passed |back as |
|000057a0| 61 20 52 65 66 4e 75 6d | 20 69 73 20 24 31 44 38 |a RefNum| is $1D8|
|000057b0| 2e 20 54 68 61 74 20 61 | 6c 73 6f 20 6d 65 61 6e |. That a|lso mean|
|000057c0| 73 20 74 68 61 74 20 74 | 68 65 20 46 43 42 20 72 |s that t|he FCB r|
|000057d0| 65 63 6f 72 64 20 69 73 | 20 24 31 44 38 20 62 79 |ecord is| $1D8 by|
|000057e0| 74 65 73 20 69 6e 74 6f | 20 74 68 65 20 46 43 42 |tes into| the FCB|
|000057f0| 20 62 6c 6f 63 6b 2e 0d | 41 20 76 69 73 75 61 6c | block..|A visual|
|00005800| 20 65 78 61 6d 70 6c 65 | 20 6f 66 20 61 20 72 65 | example| of a re|
|00005810| 63 6f 72 64 20 62 65 69 | 6e 67 20 69 6e 20 75 73 |cord bei|ng in us|
|00005820| 65 2c 20 61 6e 64 20 68 | 6f 77 20 74 68 65 20 52 |e, and h|ow the R|
|00005830| 65 66 4e 75 6d 20 69 73 | 20 72 65 6c 61 74 65 64 |efNum is| related|
|00005840| 20 69 73 3a 0d 42 61 73 | 65 20 69 73 20 6d 65 72 | is:.Bas|e is mer|
|00005850| 65 6c 79 20 74 68 65 20 | 61 64 64 72 65 73 73 20 |ely the |address |
|00005860| 6f 66 20 74 68 65 20 6e | 6f 6e 72 65 6c 6f 63 61 |of the n|onreloca|
|00005870| 74 61 62 6c 65 20 62 6c | 6f 63 6b 20 74 68 61 74 |table bl|ock that|
|00005880| 20 69 73 20 74 68 65 20 | 46 43 42 20 62 75 66 66 | is the |FCB buff|
|00005890| 65 72 2e 20 46 43 42 53 | 50 74 72 20 70 6f 69 6e |er. FCBS|Ptr poin|
|000058a0| 74 73 20 74 6f 20 69 74 | 2e 20 54 68 65 20 52 65 |ts to it|. The Re|
|000058b0| 66 4e 75 6d 20 28 61 20 | 6e 75 6d 62 65 72 20 6c |fNum (a |number l|
|000058c0| 69 6b 65 20 24 31 44 38 | 29 20 69 73 20 61 64 64 |ike $1D8|) is add|
|000058d0| 65 64 20 74 6f 20 42 61 | 73 65 2c 20 74 6f 20 67 |ed to Ba|se, to g|
|000058e0| 69 76 65 20 61 6e 20 61 | 64 64 72 65 73 73 20 69 |ive an a|ddress i|
|000058f0| 6e 20 74 68 65 20 62 6c | 6f 63 6b 2e 20 54 68 61 |n the bl|ock. Tha|
|00005900| 74 20 61 64 64 72 65 73 | 73 20 69 73 20 77 68 61 |t addres|s is wha|
|00005910| 74 20 74 68 65 20 66 69 | 6c 65 20 73 79 73 74 65 |t the fi|le syste|
|00005920| 6d 20 77 69 6c 6c 20 75 | 73 65 20 74 6f 20 72 65 |m will u|se to re|
|00005930| 61 64 20 61 6e 64 20 77 | 72 69 74 65 20 74 6f 20 |ad and w|rite to |
|00005940| 61 6e 20 6f 70 65 6e 20 | 66 69 6c 65 2c 20 77 68 |an open |file, wh|
|00005950| 69 63 68 20 69 73 20 77 | 68 79 20 79 6f 75 20 61 |ich is w|hy you a|
|00005960| 72 65 20 72 65 71 75 69 | 72 65 64 20 74 6f 20 70 |re requi|red to p|
|00005970| 61 73 73 20 74 68 65 20 | 52 65 66 4e 75 6d 20 74 |ass the |RefNum t|
|00005980| 6f 20 74 68 65 20 50 42 | 52 65 61 64 20 61 6e 64 |o the PB|Read and|
|00005990| 20 50 42 57 72 69 74 65 | 20 63 61 6c 6c 73 2e 0d | PBWrite| calls..|
|000059a0| 53 69 6e 63 65 20 74 68 | 61 74 20 52 65 66 4e 75 |Since th|at RefNu|
|000059b0| 6d 20 69 73 20 6d 65 72 | 65 6c 79 20 61 6e 20 6f |m is mer|ely an o|
|000059c0| 66 66 73 65 74 20 69 6e | 74 6f 20 74 68 65 20 71 |ffset in|to the q|
|000059d0| 75 65 75 65 2c 20 6c 65 | 74 d5 73 20 73 74 65 70 |ueue, le|t.s step|
|000059e0| 20 74 68 72 6f 75 67 68 | 20 61 20 64 61 6e 67 65 | through| a dange|
|000059f0| 72 6f 75 73 20 69 6d 61 | 67 69 6e 61 72 79 20 73 |rous ima|ginary s|
|00005a00| 65 71 75 65 6e 63 65 20 | 61 6e 64 20 73 65 65 20 |equence |and see |
|00005a10| 77 68 61 74 20 68 61 70 | 70 65 6e 73 20 74 6f 20 |what hap|pens to |
|00005a20| 61 20 67 69 76 65 6e 20 | 72 65 63 6f 72 64 20 69 |a given |record i|
|00005a30| 6e 20 74 68 65 20 46 43 | 42 20 42 75 66 66 65 72 |n the FC|B Buffer|
|00005a40| 2e 20 48 65 72 65 d5 73 | 20 74 68 65 20 73 65 71 |. Here.s| the seq|
|00005a50| 75 65 6e 63 65 20 77 65 | 20 77 69 6c 6c 20 73 74 |uence we| will st|
|00005a60| 65 70 20 74 68 72 6f 75 | 67 68 3a 0d 09 45 72 72 |ep throu|gh:..Err|
|00005a70| 53 74 75 66 66 20 3a 3d | 20 46 53 4f 70 65 6e 20 |Stuff :=| FSOpen |
|00005a80| 28 27 46 69 72 73 74 46 | 69 6c 65 27 2c 20 74 68 |('FirstF|ile', th|
|00005a90| 65 56 52 65 66 4e 75 6d | 2c 20 46 69 72 73 74 52 |eVRefNum|, FirstR|
|00005aa0| 65 66 4e 75 6d 29 3b 0d | 09 45 72 72 53 74 75 66 |efNum);.|.ErrStuf|
|00005ab0| 66 20 3a 3d 20 46 53 43 | 6c 6f 73 65 20 28 20 46 |f := FSC|lose ( F|
|00005ac0| 69 72 73 74 52 65 66 4e | 75 6d 20 29 3b 0d 09 45 |irstRefN|um );..E|
|00005ad0| 72 72 53 74 75 66 66 20 | 3a 3d 20 46 53 4f 70 65 |rrStuff |:= FSOpe|
|00005ae0| 6e 20 28 27 53 65 63 6f | 6e 64 46 69 6c 65 27 2c |n ('Seco|ndFile',|
|00005af0| 20 74 68 65 56 52 65 66 | 4e 75 6d 2c 20 53 65 63 | theVRef|Num, Sec|
|00005b00| 6f 6e 64 52 65 66 4e 75 | 6d 29 3b 0d 09 45 72 72 |ondRefNu|m);..Err|
|00005b10| 53 74 75 66 66 20 3a 3d | 20 46 53 43 6c 6f 73 65 |Stuff :=| FSClose|
|00005b20| 20 28 20 46 69 72 73 74 | 52 65 66 4e 75 6d 20 29 | ( First|RefNum )|
|00005b30| 3b 20 7b 74 68 65 20 77 | 72 6f 6e 67 20 66 69 6c |; {the w|rong fil|
|00005b40| 65 20 67 65 74 73 20 63 | 6c 6f 73 65 64 21 21 21 |e gets c|losed!!!|
|00005b50| 7d 0d 09 7b 74 68 65 20 | 61 62 6f 76 65 20 6c 69 |}..{the |above li|
|00005b60| 6e 65 20 77 69 6c 6c 20 | 63 6c 6f 73 65 20 27 53 |ne will |close 'S|
|00005b70| 65 63 6f 6e 64 46 69 6c | 65 27 2c 20 6e 6f 74 20 |econdFil|e', not |
|00005b80| 27 46 69 72 73 74 46 69 | 6c 65 27 2c 20 77 68 69 |'FirstFi|le', whi|
|00005b90| 63 68 20 69 73 0d 09 20 | 61 6c 72 65 61 64 79 20 |ch is.. |already |
|00005ba0| 63 6c 6f 73 65 64 7d 0d | 09 09 09 09 09 09 42 65 |closed}.|......Be|
|00005bb0| 66 6f 72 65 20 61 6e 79 | 20 6f 70 65 72 61 74 69 |fore any| operati|
|00005bc0| 6f 6e 73 3a 0d 09 09 09 | 09 09 20 20 20 20 20 20 |ons:....|.. |
|00005bd0| 74 68 65 20 72 65 63 6f | 72 64 20 61 74 20 24 31 |the reco|rd at $1|
|00005be0| 44 38 20 69 73 20 6e 6f | 74 20 75 73 65 64 2e 0d |D8 is no|t used..|
|00005bf0| 09 09 09 09 09 09 09 41 | 66 74 65 72 20 74 68 65 |.......A|fter the|
|00005c00| 20 63 61 6c 6c 3a 0d 09 | 09 09 09 45 72 72 53 74 | call:..|...ErrSt|
|00005c10| 75 66 66 20 3a 3d 20 46 | 53 4f 70 65 6e 20 28 27 |uff := F|SOpen ('|
|00005c20| 46 69 72 73 74 46 69 6c | 65 27 2c 20 74 68 65 56 |FirstFil|e', theV|
|00005c30| 52 65 66 4e 75 6d 2c 20 | 09 09 09 09 09 09 20 20 |RefNum, |...... |
|00005c40| 20 20 20 46 69 72 73 74 | 52 65 66 4e 75 6d 29 3b | First|RefNum);|
|00005c50| 0d 09 09 09 09 20 20 20 | 20 20 20 20 46 69 72 73 |..... | Firs|
|00005c60| 74 52 65 66 4e 75 6d 20 | 3d 20 24 31 44 38 20 61 |tRefNum |= $1D8 a|
|00005c70| 6e 64 20 74 68 65 20 72 | 65 63 6f 72 64 20 69 73 |nd the r|ecord is|
|00005c80| 20 69 6e 20 75 73 65 2e | 0d 09 09 09 09 09 09 09 | in use.|........|
|00005c90| 41 66 74 65 72 20 74 68 | 65 20 63 61 6c 6c 3a 0d |After th|e call:.|
|00005ca0| 09 09 09 45 72 72 53 74 | 75 66 66 20 3a 3d 20 46 |...ErrSt|uff := F|
|00005cb0| 53 43 6c 6f 73 65 20 28 | 46 69 72 73 74 52 65 66 |SClose (|FirstRef|
|00005cc0| 4e 75 6d 29 3b 0d 09 09 | 09 20 20 20 46 69 72 73 |Num);...|. Firs|
|00005cd0| 74 52 65 66 4e 75 6d 20 | 69 73 20 73 74 69 6c 6c |tRefNum |is still|
|00005ce0| 20 65 71 75 61 6c 20 74 | 6f 20 24 31 44 38 2c 20 | equal t|o $1D8, |
|00005cf0| 62 75 74 20 74 68 65 20 | 46 43 42 20 72 65 63 6f |but the |FCB reco|
|00005d00| 72 64 20 69 73 20 09 09 | 09 09 20 20 20 75 6e 75 |rd is ..|.. unu|
|00005d10| 73 65 64 2e 0d 09 09 09 | 09 09 09 09 41 66 74 65 |sed.....|....Afte|
|00005d20| 72 20 74 68 65 20 63 61 | 6c 6c 3a 0d 09 09 09 45 |r the ca|ll:....E|
|00005d30| 72 72 53 74 75 66 66 20 | 3a 3d 20 46 53 4f 70 65 |rrStuff |:= FSOpe|
|00005d40| 6e 20 28 27 53 65 63 6f | 6e 64 46 69 6c 65 27 2c |n ('Seco|ndFile',|
|00005d50| 20 74 68 65 56 52 65 66 | 4e 75 6d 2c 20 53 65 63 | theVRef|Num, Sec|
|00005d60| 6f 6e 64 52 65 66 4e 75 | 6d 29 3b 0d 09 09 09 20 |ondRefNu|m);.... |
|00005d70| 53 65 63 6f 6e 64 52 65 | 66 4e 75 6d 20 3d 20 24 |SecondRe|fNum = $|
|00005d80| 31 44 38 2c 20 46 69 72 | 73 74 52 65 66 4e 75 6d |1D8, Fir|stRefNum|
|00005d90| 20 3d 20 24 31 44 38 2c | 20 61 6e 64 20 74 68 65 | = $1D8,| and the|
|00005da0| 20 72 65 63 6f 72 64 20 | 69 73 20 09 09 09 09 20 | record |is .... |
|00005db0| 72 65 75 73 65 64 2e 0d | 09 09 09 09 09 09 09 41 |reused..|.......A|
|00005dc0| 66 74 65 72 20 74 68 65 | 20 63 61 6c 6c 3a 0d 09 |fter the| call:..|
|00005dd0| 09 09 09 09 20 20 20 20 | 20 20 20 20 20 20 20 20 |.... | |
|00005de0| 45 72 72 53 74 75 66 66 | 20 3a 3d 20 46 53 43 6c |ErrStuff| := FSCl|
|00005df0| 6f 73 65 20 28 46 69 72 | 73 74 52 65 66 4e 75 6d |ose (Fir|stRefNum|
|00005e00| 29 3b 0d 09 09 09 09 20 | 20 20 20 54 68 65 20 46 |);..... | The F|
|00005e10| 69 72 73 74 52 65 66 4e | 75 6d 20 3d 20 24 31 44 |irstRefN|um = $1D|
|00005e20| 38 2c 20 53 65 63 6f 6e | 64 52 65 66 4e 75 6d 20 |8, Secon|dRefNum |
|00005e30| 3d 20 24 31 44 38 2c 20 | 0d 74 68 65 20 71 75 65 |= $1D8, |.the que|
|00005e40| 75 65 20 65 6c 65 6d 65 | 6e 74 20 69 73 20 63 6c |ue eleme|nt is cl|
|00005e50| 65 61 72 65 64 2e 20 54 | 68 69 73 20 68 61 70 70 |eared. T|his happ|
|00005e60| 65 6e 73 2c 20 65 76 65 | 6e 20 74 68 6f 75 67 68 |ens, eve|n though|
|00005e70| 20 46 69 72 73 74 46 69 | 6c 65 20 77 61 73 20 61 | FirstFi|le was a|
|00005e80| 6c 72 65 61 64 79 20 63 | 6c 6f 73 65 64 2e 20 41 |lready c|losed. A|
|00005e90| 63 74 75 61 6c 6c 79 2c | 20 53 65 63 6f 6e 64 46 |ctually,| SecondF|
|00005ea0| 69 6c 65 20 77 61 73 20 | 63 6c 6f 73 65 64 3a 0d |ile was |closed:.|
|00005eb0| 4e 6f 74 65 20 74 68 61 | 74 20 74 68 65 20 73 65 |Note tha|t the se|
|00005ec0| 63 6f 6e 64 20 63 6c 6f | 73 65 20 69 73 20 75 73 |cond clo|se is us|
|00005ed0| 69 6e 67 20 74 68 65 20 | 6f 6c 64 20 52 65 66 4e |ing the |old RefN|
|00005ee0| 75 6d 2e 20 54 68 65 20 | 73 65 63 6f 6e 64 20 63 |um. The |second c|
|00005ef0| 6c 6f 73 65 20 77 69 6c | 6c 20 73 74 69 6c 6c 20 |lose wil|l still |
|00005f00| 63 6c 6f 73 65 20 61 20 | 66 69 6c 65 2c 20 61 6e |close a |file, an|
|00005f10| 64 20 69 6e 20 66 61 63 | 74 20 77 69 6c 6c 20 72 |d in fac|t will r|
|00005f20| 65 74 75 72 6e 20 6e 6f | 45 72 72 20 61 73 20 69 |eturn no|Err as i|
|00005f30| 74 73 20 72 65 73 75 6c | 74 2e 20 41 6e 79 20 73 |ts resul|t. Any s|
|00005f40| 75 62 73 65 71 75 65 6e | 74 20 61 63 63 65 73 73 |ubsequen|t access|
|00005f50| 65 73 20 74 6f 20 74 68 | 65 20 53 65 63 6f 6e 64 |es to th|e Second|
|00005f60| 52 65 66 4e 75 6d 20 77 | 69 6c 6c 20 72 65 74 75 |RefNum w|ill retu|
|00005f70| 72 6e 20 61 6e 20 65 72 | 72 6f 72 2c 20 73 69 6e |rn an er|ror, sin|
|00005f80| 63 65 20 74 68 65 20 66 | 69 6c 65 20 d4 53 65 63 |ce the f|ile .Sec|
|00005f90| 6f 6e 64 46 69 6c 65 d5 | 20 77 61 73 20 63 6c 6f |ondFile.| was clo|
|00005fa0| 73 65 64 2e 20 54 68 65 | 20 46 69 6c 65 20 43 6f |sed. The| File Co|
|00005fb0| 6e 74 72 6f 6c 20 42 6c | 6f 63 6b 73 20 61 72 65 |ntrol Bl|ocks are|
|00005fc0| 20 72 65 75 73 65 64 2c | 20 61 6e 64 20 73 69 6e | reused,| and sin|
|00005fd0| 63 65 20 74 68 65 79 20 | 61 72 65 20 6a 75 73 74 |ce they |are just|
|00005fe0| 20 6f 66 66 73 65 74 73 | 2c 20 69 74 20 69 73 20 | offsets|, it is |
|00005ff0| 70 6f 73 73 69 62 6c 65 | 20 74 6f 20 67 65 74 20 |possible| to get |
|00006000| 74 68 65 20 73 61 6d 65 | 20 66 69 6c 65 20 52 65 |the same| file Re|
|00006010| 66 4e 75 6d 20 62 61 63 | 6b 20 66 6f 72 20 74 77 |fNum bac|k for tw|
|00006020| 6f 20 64 69 66 66 65 72 | 65 6e 74 20 66 69 6c 65 |o differ|ent file|
|00006030| 73 2e 20 49 6e 20 74 68 | 69 73 20 63 61 73 65 2c |s. In th|is case,|
|00006040| 20 46 69 72 73 74 52 65 | 66 4e 75 6d 20 3d 20 53 | FirstRe|fNum = S|
|00006050| 65 63 6f 6e 64 52 65 66 | 4e 75 6d 20 73 69 6e 63 |econdRef|Num sinc|
|00006060| 65 20 d4 46 69 72 73 74 | 46 69 6c 65 d5 20 77 61 |e .First|File. wa|
|00006070| 73 20 63 6c 6f 73 65 64 | 20 62 65 66 6f 72 65 20 |s closed| before |
|00006080| 6f 70 65 6e 69 6e 67 20 | d4 53 65 63 6f 6e 64 46 |opening |.SecondF|
|00006090| 69 6c 65 d5 20 61 6e 64 | 20 74 68 65 20 73 61 6d |ile. and| the sam|
|000060a0| 65 20 46 43 42 20 72 65 | 63 6f 72 64 20 77 61 73 |e FCB re|cord was|
|000060b0| 20 72 65 75 73 65 64 20 | 66 6f 72 20 d4 53 65 63 | reused |for .Sec|
|000060c0| 6f 6e 64 46 69 6c 65 d5 | 2e 0d 54 68 65 72 65 20 |ondFile.|..There |
|000060d0| 61 72 65 20 77 6f 72 73 | 65 20 63 61 73 65 73 20 |are wors|e cases |
|000060e0| 74 68 61 6e 20 74 68 69 | 73 2c 20 68 6f 77 65 76 |than thi|s, howev|
|000060f0| 65 72 2e 20 41 73 20 61 | 6e 20 65 78 61 6d 70 6c |er. As a|n exampl|
|00006100| 65 2c 20 74 68 69 6e 6b | 20 6f 66 20 77 68 61 74 |e, think| of what|
|00006110| 20 63 61 6e 20 68 61 70 | 70 65 6e 20 69 66 20 61 | can hap|pen if a|
|00006120| 20 70 72 6f 67 72 61 6d | 20 77 65 72 65 20 74 6f | program| were to|
|00006130| 20 63 6c 6f 73 65 20 61 | 20 66 69 6c 65 2c 20 74 | close a| file, t|
|00006140| 68 65 6e 20 74 68 65 20 | 75 73 65 72 20 69 6e 73 |hen the |user ins|
|00006150| 65 72 74 65 64 20 61 6e | 20 48 46 53 20 64 69 73 |erted an| HFS dis|
|00006160| 6b 2e 20 54 68 65 20 46 | 43 42 20 63 6f 75 6c 64 |k. The F|CB could|
|00006170| 20 62 65 20 72 65 75 73 | 65 64 20 66 6f 72 20 74 | be reus|ed for t|
|00006180| 68 65 20 43 61 74 61 6c | 6f 67 20 46 69 6c 65 20 |he Catal|og File |
|00006190| 6f 6e 20 74 68 61 74 20 | 48 46 53 20 64 69 73 6b |on that |HFS disk|
|000061a0| 2e 20 49 66 20 74 68 65 | 20 70 72 6f 67 72 61 6d |. If the| program|
|000061b0| 20 68 61 64 20 61 20 67 | 65 6e 65 72 69 63 20 65 | had a g|eneric e|
|000061c0| 72 72 6f 72 20 68 61 6e | 64 6c 65 72 20 74 68 61 |rror han|dler tha|
|000061d0| 74 20 63 6c 6f 73 65 64 | 20 61 6c 6c 20 6f 66 20 |t closed| all of |
|000061e0| 69 74 73 20 66 69 6c 65 | 73 2c 20 69 74 20 63 6f |its file|s, it co|
|000061f0| 75 6c 64 20 69 6e 61 64 | 76 65 72 74 65 6e 74 6c |uld inad|vertentl|
|00006200| 79 20 63 6c 6f 73 65 20 | d2 69 74 73 d3 20 66 69 |y close |.its. fi|
|00006210| 6c 65 20 61 67 61 69 6e | 2e 20 49 66 20 69 74 20 |le again|. If it |
|00006220| 74 68 6f 75 67 68 74 20 | d2 69 74 73 d3 20 66 69 |thought |.its. fi|
|00006230| 6c 65 20 77 61 73 20 73 | 74 69 6c 6c 20 6f 70 65 |le was s|till ope|
|00006240| 6e 20 69 74 20 77 6f 75 | 6c 64 20 64 6f 20 74 68 |n it wou|ld do th|
|00006250| 65 20 63 6c 6f 73 65 2c | 20 77 68 69 63 68 20 63 |e close,| which c|
|00006260| 6f 75 6c 64 20 63 6c 6f | 73 65 20 74 68 65 20 43 |ould clo|se the C|
|00006270| 61 74 61 6c 6f 67 20 66 | 69 6c 65 20 6f 6e 20 74 |atalog f|ile on t|
|00006280| 68 65 20 48 46 53 20 64 | 69 73 6b 2e 20 54 68 69 |he HFS d|isk. Thi|
|00006290| 73 20 69 73 20 63 61 74 | 61 73 74 72 6f 70 68 69 |s is cat|astrophi|
|000062a0| 63 20 66 6f 72 20 74 68 | 65 20 64 69 73 6b 20 73 |c for th|e disk s|
|000062b0| 69 6e 63 65 20 74 68 65 | 20 66 69 6c 65 20 63 6f |ince the| file co|
|000062c0| 75 6c 64 20 65 61 73 69 | 6c 79 20 62 65 20 63 6c |uld easi|ly be cl|
|000062d0| 6f 73 65 64 20 69 6e 20 | 61 6e 20 69 6e 63 6f 6e |osed in |an incon|
|000062e0| 73 69 73 74 65 6e 74 20 | 73 74 61 74 65 2e 20 54 |sistent |state. T|
|000062f0| 68 65 20 72 65 73 75 6c | 74 20 69 73 20 61 20 62 |he resul|t is a b|
|00006300| 61 64 20 64 69 73 6b 20 | 74 68 61 74 20 6e 65 65 |ad disk |that nee|
|00006310| 64 73 20 74 6f 20 62 65 | 20 72 65 66 6f 72 6d 61 |ds to be| reforma|
|00006320| 74 74 65 64 2e 20 0d 54 | 68 65 72 65 20 61 72 65 |tted. .T|here are|
|00006330| 20 61 6e 79 20 6e 75 6d | 62 65 72 20 6f 66 20 6e | any num|ber of n|
|00006340| 61 73 74 79 20 63 61 73 | 65 73 20 74 68 61 74 20 |asty cas|es that |
|00006350| 63 61 6e 20 61 72 69 73 | 65 20 69 66 20 61 20 66 |can aris|e if a f|
|00006360| 69 6c 65 20 69 73 20 63 | 6c 6f 73 65 64 20 74 77 |ile is c|losed tw|
|00006370| 69 63 65 2c 20 72 65 75 | 73 69 6e 67 20 61 6e 20 |ice, reu|sing an |
|00006380| 6f 6c 64 20 52 65 66 4e | 75 6d 2e 20 41 20 63 6f |old RefN|um. A co|
|00006390| 6d 6d 6f 6e 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |mmon pro|gramming|
|000063a0| 20 70 72 61 63 74 69 63 | 65 20 69 73 20 74 6f 20 | practic|e is to |
|000063b0| 68 61 76 65 20 61 6e 20 | 65 72 72 6f 72 20 68 61 |have an |error ha|
|000063c0| 6e 64 6c 65 72 20 6f 72 | 20 63 6c 65 61 6e 75 70 |ndler or| cleanup|
|000063d0| 20 72 6f 75 74 69 6e 65 | 20 74 68 61 74 20 67 6f | routine| that go|
|000063e0| 65 73 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 66 |es throu|gh the f|
|000063f0| 69 6c 65 73 20 74 68 61 | 74 20 61 20 70 72 6f 67 |iles tha|t a prog|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.